Skip to content

Commit

Permalink
Increase Hosting test delay to fix flaky BackgroundServiceAsyncExcept…
Browse files Browse the repository at this point in the history
…ionGetsLogged test.

Fix dotnet#43389
  • Loading branch information
eerhardt committed Nov 19, 2020
1 parent 5b48cae commit b7d7117
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,9 @@ private class AsyncThrowingService : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
await Task.Yield();
// Delay long enough that BackgroundService.StartAsync gets a chance to complete
// before the exception is thrown. But don't delay for too long so the test completes quickly.
await Task.Delay(50);

throw new Exception("Background Exception");
}
Expand Down

0 comments on commit b7d7117

Please sign in to comment.