PYTHON-1178 - Fix race in test_local_threshold test.

This commit is contained in:
Luke Lovett 2016-11-16 10:07:31 -08:00
parent 9128866f58
commit 807f719405

View File

@ -161,8 +161,14 @@ class TestMongosLoadBalancing(MockClientTest):
client.db.command('ismaster')
except:
pass
# No error
client.db.command('ismaster')
# We eventually connect to a new mongos.
def connect_to_new_mongos():
try:
return client.db.command('ismaster')
except AutoReconnect:
pass
wait_until(connect_to_new_mongos, 'connect to a new mongos')
def test_load_balancing(self):
# Although the server selection JSON tests already prove that