Skip to content

Commit

Permalink
nit: dispose CancellationTokenSource on tests (#2916)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanotti authored Sep 6, 2023
1 parent 54b9853 commit 3bbdbcd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/IntegrationTests/Helpers/MockLogsCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void AssertExpectations(TimeSpan? timeout = null)
var additionalEntries = new List<LogRecord>();

timeout ??= TestTimeout.Expectation;
var cts = new CancellationTokenSource();
using var cts = new CancellationTokenSource();

try
{
Expand Down
2 changes: 1 addition & 1 deletion test/IntegrationTests/Helpers/MockMetricsCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void AssertExpectations(TimeSpan? timeout = null)
var additionalEntries = new List<Collected>();

timeout ??= TestTimeout.Expectation;
var cts = new CancellationTokenSource();
using var cts = new CancellationTokenSource();

try
{
Expand Down
2 changes: 1 addition & 1 deletion test/IntegrationTests/Helpers/MockSpansCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void AssertExpectations(TimeSpan? timeout = null)
var additionalEntries = new List<Collected>();

timeout ??= TestTimeout.Expectation;
var cts = new CancellationTokenSource();
using var cts = new CancellationTokenSource();

try
{
Expand Down
2 changes: 1 addition & 1 deletion test/IntegrationTests/Helpers/MockZipkinCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void AssertExpectations(TimeSpan? timeout = null)
var additionalEntries = new List<ZSpanMock>();

timeout ??= TestTimeout.Expectation;
var cts = new CancellationTokenSource();
using var cts = new CancellationTokenSource();

try
{
Expand Down
2 changes: 1 addition & 1 deletion test/IntegrationTests/WcfIISTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private async Task<IContainer> StartContainerAsync(int netTcpPort, int httpPort)
}

var container = builder.Build();
var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
using var cts = new CancellationTokenSource(TimeSpan.FromMinutes(5));
try
{
await container.StartAsync(cts.Token);
Expand Down

0 comments on commit 3bbdbcd

Please sign in to comment.