Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from test import client_knobs, unittest
from test.pymongo_mocks import DummyMonitor
from test.utils import MockPool, flaky
from test.utils import MockPool
from test.utils_shared import wait_until

from bson.objectid import ObjectId
Expand Down Expand Up @@ -755,7 +755,6 @@ def get_primary():
class TestTopologyErrors(TopologyTest):
# Errors when calling hello.

@flaky(reason="PYTHON-5366")
def test_pool_reset(self):
# hello succeeds at first, then always raises socket error.
hello_count = [0]
Expand All @@ -776,7 +775,11 @@ def _check_with_socket(self, *args, **kwargs):

# Pool is reset by hello failure.
t.request_check_all()
self.assertNotEqual(generation, server.pool.gen.get_overall())
# Wait for the monitor's hello failure to trigger Pool.reset() and bump the generation.
wait_until(
lambda: server.pool.gen.get_overall() != generation,
"pool reset after failed monitor check",
)

def test_hello_retry(self):
# hello succeeds at first, then raises socket error, then succeeds.
Expand Down
Loading