Skip to content

Commit

Permalink
CSHARP-4253: Increase heartbeatInterval in ConnectionPool_cleared_on_…
Browse files Browse the repository at this point in the history
…failed_hello test to avoid race condition between RTT and monitoring threads. (#848)
  • Loading branch information
JamesKovacs authored Jul 14, 2022
1 parent 50db4b7 commit 0d720c8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ public void ConnectionPool_cleared_on_failed_hello()
RequireServer.Check().VersionGreaterThanOrEqualTo(minVersion);

const string appName = "SDAMPoolManagementTest";
var heartbeatInterval = TimeSpan.FromMilliseconds(100);
// Using a 100ms heartbeatInterval can result in sporadic failures of this test if the RTT thread
// consumes both of the configured failpoints before the monitoring thread can run.
// Increasing the heartbeatInterval to 200ms avoids this race condition.
var heartbeatInterval = TimeSpan.FromMilliseconds(200);
var eventsWaitTimeout = TimeSpan.FromMilliseconds(5000);

var failPointCommand = BsonDocument.Parse(
Expand Down

0 comments on commit 0d720c8

Please sign in to comment.