Skip to content

Commit

Permalink
* Unblock so that CloseAsync can succeed.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Sep 25, 2024
1 parent 8b54bf4 commit 748ec8c
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions projects/Test/SequentialIntegration/TestConnectionRecovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,24 @@ Task _channel_ChannelShutdownAsync(object sender, ShutdownEventArgs e)
[Fact]
public async Task TestBlockedListenersRecovery()
{
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
_conn.ConnectionBlockedAsync += (c, reason) =>
try
{
tcs.SetResult(true);
return Task.CompletedTask;
};
await CloseAndWaitForRecoveryAsync();
await CloseAndWaitForRecoveryAsync();
await BlockAndPublishAsync();
await WaitAsync(tcs, "connection blocked");
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
_conn.ConnectionBlockedAsync += (c, reason) =>
{
tcs.SetResult(true);
return Task.CompletedTask;
};
await CloseAndWaitForRecoveryAsync();
await CloseAndWaitForRecoveryAsync();
await BlockAndPublishAsync();
await WaitAsync(tcs, "connection blocked");
}
finally
{
// NOTE: must unblock so that close succeeeds on test tear-down
await UnblockAsync();
}
}

[Fact]
Expand Down

0 comments on commit 748ec8c

Please sign in to comment.