Skip to content

Commit

Permalink
DRIVERS-2951 Test that serverMonitoringMode=poll waits after a succes…
Browse files Browse the repository at this point in the history
…sful heartbeat
  • Loading branch information
ShaneHarvey committed Aug 2, 2024
1 parent 34b9d46 commit 8692940
Show file tree
Hide file tree
Showing 2 changed files with 106 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,45 @@ 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
- serverHeartbeatFailedEvent
- 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
# expectEvents: *streamingStartedEvents

0 comments on commit 8692940

Please sign in to comment.