Skip to content

Commit

Permalink
DRIVERS-2951 Test serverMonitoringMode=poll waits after a successful …
Browse files Browse the repository at this point in the history
…heartbeat (#1626)
  • Loading branch information
ShaneHarvey committed Aug 5, 2024
1 parent 34b9d46 commit 121be10
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,43 @@ tests:
# Wait for the second serverHeartbeatStartedEvent to ensure we do not stream.
- *waitForSecondHeartbeatStarted
expectEvents: *pollingStartedEvents

- description: "poll waits after successful heartbeat"
operations:
- name: createEntities
object: testRunner
arguments:
entities:
- client:
id: client
uriOptions:
serverMonitoringMode: "poll"
heartbeatFrequencyMS: 1000000
useMultipleMongoses: false
observeEvents:
- serverHeartbeatStartedEvent
- serverHeartbeatSucceededEvent
- database:
id: db
client: client
databaseName: sdam-tests
# Wait for the first serverHeartbeatSucceededEvent to ensure we start polling.
- name: waitForEvent
object: testRunner
arguments:
client: client
event:
serverHeartbeatSucceededEvent: {}
count: 1
# Wait for a bit longer to ensure we wait heartbeatFrequencyMS before starting the next check.
- name: wait
object: testRunner
arguments:
ms: 500
- name: assertEventCount
object: testRunner
arguments:
client: client
event:
serverHeartbeatStartedEvent: {}
count: 1

0 comments on commit 121be10

Please sign in to comment.