Skip to content

Commit

Permalink
Fix race condition in Hosting test (#44548)
Browse files Browse the repository at this point in the history
Change Task.Delay(1) to Task.Yield() to avoid a super race condition.

Fix #43389
  • Loading branch information
eerhardt authored Nov 12, 2020
1 parent 1db961e commit 26dba43
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ private class AsyncThrowingService : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
await Task.Delay(1);
await Task.Yield();

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

0 comments on commit 26dba43

Please sign in to comment.