Skip to content

Commit 520cf31

Browse files
committed
PYTHON-1204 - More reliable test_client_disconnect
1 parent 93fd58a commit 520cf31

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

test/test_threads.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
IntegrationTest,
2323
unittest)
2424
from test.utils import rs_or_single_client_noauth, rs_or_single_client
25-
from test.utils import frequent_thread_switches, joinall
25+
from test.utils import joinall
2626
from pymongo.errors import OperationFailure
2727

2828

@@ -193,15 +193,14 @@ def test_client_disconnect(self):
193193
threads = [SaveAndFind(db.test) for _ in range(10)]
194194
threads.extend(Disconnect(db.client, 10) for _ in range(10))
195195

196-
with frequent_thread_switches():
197-
for t in threads:
198-
t.start()
196+
for t in threads:
197+
t.start()
199198

200-
for t in threads:
201-
t.join(300)
199+
for t in threads:
200+
t.join(300)
202201

203-
for t in threads:
204-
self.assertTrue(t.passed)
202+
for t in threads:
203+
self.assertTrue(t.passed)
205204

206205

207206
class TestThreadsAuth(IntegrationTest):

0 commit comments

Comments
 (0)