-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DRIVERS-2711: Publish Topology Description Changed Event on Topology …
…Close (#1495)
- Loading branch information
Showing
13 changed files
with
642 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
...scovery-and-monitoring/tests/unified/loadbalanced-emit-topology-changed-before-close.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
...iscovery-and-monitoring/tests/unified/loadbalanced-emit-topology-changed-before-close.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
description: "loadbalanced-emit-topology-description-changed-before-close" | ||
|
||
schemaVersion: "1.20" | ||
|
||
runOnRequirements: | ||
- topologies: | ||
- load-balanced | ||
minServerVersion: "4.4" # awaitable hello | ||
|
||
tests: | ||
- description: "Topology lifecycle" | ||
operations: | ||
- name: createEntities | ||
object: testRunner | ||
arguments: | ||
entities: | ||
- client: | ||
id: &client client | ||
observeEvents: | ||
- topologyDescriptionChangedEvent | ||
- topologyOpeningEvent | ||
- topologyClosedEvent | ||
# ensure the topology has been fully discovered before closing the client. | ||
# expected events are initial server discovery and server connect event. | ||
- name: waitForEvent | ||
object: testRunner | ||
arguments: | ||
client: *client | ||
event: | ||
topologyDescriptionChangedEvent: {} | ||
count: 2 | ||
- name: close | ||
object: *client | ||
expectEvents: | ||
- client: *client | ||
eventType: sdam | ||
events: | ||
- topologyOpeningEvent: {} | ||
- topologyDescriptionChangedEvent: # unknown -> unknown w disconnected server | ||
previousDescription: | ||
type: "Unknown" | ||
newDescription: {} | ||
- topologyDescriptionChangedEvent: # unknown w disconnected server -> loadBalanced | ||
newDescription: | ||
type: "LoadBalanced" | ||
- topologyDescriptionChangedEvent: # loadbalanced -> unknown | ||
newDescription: | ||
type: "Unknown" | ||
- topologyClosedEvent: {} |
16 changes: 16 additions & 0 deletions
16
source/server-discovery-and-monitoring/tests/unified/logging-loadbalanced.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...discovery-and-monitoring/tests/unified/replicaset-emit-topology-changed-before-close.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
...-discovery-and-monitoring/tests/unified/replicaset-emit-topology-changed-before-close.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
description: "replicaset-emit-topology-description-changed-before-close" | ||
|
||
schemaVersion: "1.20" | ||
|
||
runOnRequirements: | ||
- topologies: | ||
- replicaset | ||
minServerVersion: "4.4" # awaitable hello | ||
|
||
tests: | ||
- description: "Topology lifecycle" | ||
operations: | ||
- name: createEntities | ||
object: testRunner | ||
arguments: | ||
entities: | ||
- client: | ||
id: &client client | ||
observeEvents: | ||
- topologyDescriptionChangedEvent | ||
- topologyOpeningEvent | ||
- topologyClosedEvent | ||
# ensure the topology has been fully discovered before closing the client. | ||
# expected events are initial server discovery and 3 server connect events. | ||
- name: waitForEvent | ||
object: testRunner | ||
arguments: | ||
client: *client | ||
event: | ||
topologyDescriptionChangedEvent: {} | ||
count: 4 | ||
- name: close | ||
object: *client | ||
expectEvents: | ||
- client: *client | ||
eventType: sdam | ||
ignoreExtraEvents: false | ||
events: | ||
- topologyOpeningEvent: {} | ||
- topologyDescriptionChangedEvent: {} # unknown -> replset no primary | ||
- topologyDescriptionChangedEvent: {} # server connected | ||
- topologyDescriptionChangedEvent: {} # server connected | ||
- topologyDescriptionChangedEvent: {} # server connected | ||
- topologyDescriptionChangedEvent: # replicaset -> unknown | ||
previousDescription: | ||
type: "ReplicaSetWithPrimary" | ||
newDescription: | ||
type: "Unknown" | ||
- topologyClosedEvent: {} |
Oops, something went wrong.