Skip to content

Commit 1eb5e85

Browse files
committed
fix flaky unit test
1 parent bd047fb commit 1eb5e85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/WebJobs.Script.Tests/FunctionsSyncServiceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public async Task StartAsync_PrimaryHost_Running_SyncsTriggers_AfterTimeout()
8181
[Fact]
8282
public async Task StartAsync_TokenCancelledBeforeTimeout_DoesNotSyncTriggers()
8383
{
84-
var cts = new CancellationTokenSource();
85-
cts.CancelAfter(_testDueTime / 2);
84+
using CancellationTokenSource cts = new();
85+
cts.Cancel();
8686
await _syncService.StartAsync(cts.Token);
8787
await Task.Delay(2 * _testDueTime);
8888

0 commit comments

Comments
 (0)