Skip to content

Commit 6c5b2ac

Browse files
authored
SPEC-1764 Test that monitors wait minHeartbeatFrequencyMS between failed server checks (#879)
1 parent 8c67a52 commit 6c5b2ac

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

source/server-discovery-and-monitoring/server-discovery-and-monitoring-tests.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,34 @@ Attempt a write to a collection.
178178

179179
Outcome: Verify that the write succeeded or failed depending on existing
180180
driver behavior with respect to the starting topology.
181+
182+
Monitors sleep at least minHeartbeatFreqencyMS between checks
183+
-------------------------------------------------------------
184+
185+
This test will be used to ensure monitors sleep for an appropriate amount of
186+
time between failed server checks so as to not flood the server with new
187+
connection creations.
188+
189+
This test requires MongoDB 4.9.0+.
190+
191+
1. Enable the following failpoint::
192+
193+
{
194+
configureFailPoint: "failCommand",
195+
mode: { times: 5 },
196+
data: {
197+
failCommands: ["isMaster"],
198+
errorCode: 1234,
199+
appName: "SDAMMinHeartbeatFrequencyTest"
200+
}
201+
}
202+
203+
2. Create a client with directConnection=true, appName="SDAMMinHeartbeatFrequencyTest", and
204+
serverSelectionTimeoutMS=5000.
205+
206+
3. Start a timer.
207+
208+
4. Execute a ``ping`` command.
209+
210+
5. Stop the timer. Assert that the ``ping`` took between 2 seconds and 3.5
211+
seconds to complete.

0 commit comments

Comments
 (0)