PYTHON-3468 [v3.13] Test failures in test_srv_polling.TestSrvPolling (#1073) (#1092)

This commit is contained in:
Steven Silvester 2022-10-24 14:57:23 -05:00 committed by GitHub
parent 8fd52e8078
commit 93608319ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -2927,8 +2927,8 @@ buildvariants:
- matrix_name: "test-linux-enterprise-auth"
matrix_spec:
platform: awslinux
python-version: *amazon1-pythons
platform: ubuntu-18.04
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7"]
auth: "auth"
display_name: "Enterprise ${auth} ${platform} ${python-version}"
tasks:

View File

@ -125,7 +125,14 @@ class TestSrvPolling(unittest.TestCase):
(WAIT_TIME * 10) seconds. Also check that the resolver is called at
least once.
"""
sleep(WAIT_TIME * 10)
def predicate():
if set(expected_nodelist) == set(self.get_nodelist(client)):
return pymongo.srv_resolver._SrvResolver.get_hosts_and_min_ttl.call_count >= 1
return False
wait_until(predicate, "Node list equals expected nodelist", timeout=100 * WAIT_TIME)
nodelist = self.get_nodelist(client)
if set(expected_nodelist) != set(nodelist):
msg = "Client nodelist %s changed unexpectedly (expected %s)"