Skip to content

Commit

Permalink
Update HostTests.cs (#51495)
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Apr 19, 2021
1 parent db3c25d commit 4bcc1c1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -710,11 +710,12 @@ public async Task HostStopsApplicationWithOneBackgroundServiceErrorAndOthersWith
var wasStoppingCalled = false;
lifetime.ApplicationStopping.Register(() =>
{
otherTcs.SetResult(true);
wasStoppingCalled = true;
otherTcs.SetResult(true);
});

await host.StartAsync();
// Ensure all completions have been signaled before continuing
await Task.WhenAll(host.StartAsync(), throwingTcs.Task, otherTcs.Task);

Assert.True(wasStartedCalled);
Assert.True(wasStoppingCalled);
Expand Down

0 comments on commit 4bcc1c1

Please sign in to comment.