Commit 37c4a41
authored
CLOUDP-383543: fix flaky secondaries check using replSetGetStatus (#824)
## Summary
`client.secondaries` in pymongo relies on async background topology
discovery — after `ismaster` initiates the connection, monitor threads
continue discovering replica set members in the background. This means
`client.secondaries` can return an empty or incomplete set immediately
after connecting, causing intermittent test failures.
This PR replaces all usages of `client.secondaries` with a new
`KubernetesTester.get_replica_set_secondaries()` helper that runs
`replSetGetStatus` on the primary. This is a synchronous call that
returns the authoritative replica set state directly from the server,
bypassing the client-side topology cache entirely.
## Proof of Work
N/A — test-only change fixing flaky assertions.
## Checklist
- [x] Have you linked a jira ticket and/or is the ticket in the title?
- [ ] Have you checked whether your jira ticket required DOCSP changes?
- [x] Have you added changelog file?
- use `skip-changelog` label if not needed1 parent f6fe7bb commit 37c4a41
File tree
5 files changed
+18
-8
lines changed- docker/mongodb-kubernetes-tests
- kubetester
- tests
- multicluster_shardedcluster
- replicaset
- shardedcluster
5 files changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1334 | 1334 | | |
1335 | 1335 | | |
1336 | 1336 | | |
1337 | | - | |
| 1337 | + | |
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
| |||
1346 | 1346 | | |
1347 | 1347 | | |
1348 | 1348 | | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
1349 | 1359 | | |
1350 | 1360 | | |
1351 | 1361 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments