Skip to content

Commit

Permalink
Reduce delay variability in KeepAliveTimeoutTests.ConnectionKeptAlive…
Browse files Browse the repository at this point in the history
…BetweenRequests() (#1157).
  • Loading branch information
Cesar Blum Silveira committed Oct 11, 2016
1 parent a15b1e2 commit 7ee1387
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ public class KeepAliveTimeoutTests
[Fact]
public async Task TestKeepAliveTimeout()
{
// Delays in these tests cannot be much longer than expected.
// Call ConfigureAwait(false) to get rid of Xunit's synchronization context,
// otherwise it can cause unexpectedly longer delays when multiple tests
// are running in parallel. These tests becomes flaky on slower
// hardware because the continuations for the delay tasks might take too long to be
// scheduled if running on Xunit's synchronization context.
await Task.Delay(1).ConfigureAwait(false);

var longRunningCancellationTokenSource = new CancellationTokenSource();
var upgradeCancellationTokenSource = new CancellationTokenSource();

Expand Down

0 comments on commit 7ee1387

Please sign in to comment.