Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DRIVERS-2951 Test serverMonitoringMode=poll waits after a successful heartbeat #1626

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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
Loading