Skip to content

Commit 6d27ccc

Browse files
committed
PYTHON-2462 fix test TODO
1 parent 5a1dd76 commit 6d27ccc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
writable_server_selector)
6363
from pymongo.server_type import SERVER_TYPE
6464
from pymongo.settings import TOPOLOGY_TYPE
65+
from pymongo.topology import _ErrorContext
6566
from pymongo.srv_resolver import _HAVE_DNSPYTHON
6667
from pymongo.write_concern import WriteConcern
6768
from test import (client_context,
@@ -1543,10 +1544,9 @@ def stop(self):
15431544

15441545
def run(self):
15451546
while self.running:
1546-
self.pool.reset()
1547-
# TODO: This may be racey: replace with
1548-
# topology.handle_error()?
1549-
self.pool.ready()
1547+
exc = AutoReconnect('mock pool error')
1548+
ctx = _ErrorContext(exc, 0, pool.generation, False)
1549+
client._topology.handle_error(pool.address, ctx)
15501550
time.sleep(0.001)
15511551

15521552
t = ResetPoolThread(pool)

0 commit comments

Comments
 (0)