PYTHON-2584 Use large localThresholdMS to fix test_load_balancing (#595)

This commit is contained in:
Shane Harvey 2021-04-21 12:04:59 -07:00 committed by GitHub
parent 85f9f7a8a1
commit b978827414
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ from pymongo.common import clean_node
from pymongo.read_preferences import ReadPreference
from test import client_context, IntegrationTest, unittest
from test.utils_selection_tests import create_topology
from test.utils import TestCreator, rs_client, OvertCommandListener
from test.utils import TestCreator, rs_client, OvertCommandListener, wait_until
# Location of JSON test specifications.
@ -127,10 +127,14 @@ class TestProse(IntegrationTest):
@client_context.require_multiple_mongoses
def test_load_balancing(self):
listener = OvertCommandListener()
# PYTHON-2584: Use a large localThresholdMS to avoid the impact of
# varying RTTs.
client = rs_client(client_context.mongos_seeds(),
appName='loadBalancingTest',
event_listeners=[listener])
event_listeners=[listener],
localThresholdMS=10000)
self.addCleanup(client.close)
wait_until(lambda: len(client.nodes) == 2, 'discover both nodes')
# Delay find commands on
delay_finds = {
'configureFailPoint': 'failCommand',