Skip to content

Commit 9f0c364

Browse files
committed
Fixes async Task return in ScheduledTimer test
Updates the ScheduledTimer test to properly await the async Task. This prevents potential issues with the test not completing correctly.
1 parent d117a43 commit 9f0c364

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/Foundatio.Tests/Utility/ScheduledTimerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ public ScheduledTimerTests(ITestOutputHelper output) : base(output)
1818
}
1919

2020
[Fact]
21-
public Task CanRun()
21+
public async Task CanRun()
2222
{
2323
var resetEvent = new AsyncAutoResetEvent();
2424
Task<DateTime?> Callback()
2525
{
2626
resetEvent.Set();
27-
return null;
27+
return Task.FromResult<DateTime?>(null);
2828
}
2929

3030
using var timer = new ScheduledTimer(Callback, loggerFactory: Log);
3131
timer.ScheduleNext();
32-
return resetEvent.WaitAsync(new CancellationTokenSource(500).Token);
32+
await resetEvent.WaitAsync(new CancellationTokenSource(500).Token);
3333
}
3434

3535
[Fact]

0 commit comments

Comments
 (0)