Skip to content

Commit 0d720c8

Browse files
authored
CSHARP-4253: Increase heartbeatInterval in ConnectionPool_cleared_on_failed_hello test to avoid race condition between RTT and monitoring threads. (#848)
1 parent 50db4b7 commit 0d720c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/MongoDB.Driver.Tests/Specifications/server-discovery-and-monitoring/ServerDiscoveryAndMonitoringProseTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ public void ConnectionPool_cleared_on_failed_hello()
179179
RequireServer.Check().VersionGreaterThanOrEqualTo(minVersion);
180180

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

185188
var failPointCommand = BsonDocument.Parse(

0 commit comments

Comments
 (0)