Skip to content

Commit 9360831

Browse files
authored
PYTHON-3468 [v3.13] Test failures in test_srv_polling.TestSrvPolling (#1073) (#1092)
1 parent 8fd52e8 commit 9360831

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.evergreen/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,8 +2927,8 @@ buildvariants:
29272927

29282928
- matrix_name: "test-linux-enterprise-auth"
29292929
matrix_spec:
2930-
platform: awslinux
2931-
python-version: *amazon1-pythons
2930+
platform: ubuntu-18.04
2931+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7"]
29322932
auth: "auth"
29332933
display_name: "Enterprise ${auth} ${platform} ${python-version}"
29342934
tasks:

test/test_srv_polling.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,14 @@ def assert_nodelist_nochange(self, expected_nodelist, client):
125125
(WAIT_TIME * 10) seconds. Also check that the resolver is called at
126126
least once.
127127
"""
128-
sleep(WAIT_TIME * 10)
128+
129+
def predicate():
130+
if set(expected_nodelist) == set(self.get_nodelist(client)):
131+
return pymongo.srv_resolver._SrvResolver.get_hosts_and_min_ttl.call_count >= 1
132+
return False
133+
134+
wait_until(predicate, "Node list equals expected nodelist", timeout=100 * WAIT_TIME)
135+
129136
nodelist = self.get_nodelist(client)
130137
if set(expected_nodelist) != set(nodelist):
131138
msg = "Client nodelist %s changed unexpectedly (expected %s)"

0 commit comments

Comments
 (0)