Skip to content

Commit 988663f

Browse files
committed
apparently order matters for typing tests?
1 parent 690dcf7 commit 988663f

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

test/asynchronous/test_mongos_load_balancing.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,7 @@ def asyncSetUpModule():
4040
pass
4141

4242

43-
if _IS_SYNC:
44-
45-
class SimpleOp(threading.Thread):
46-
def __init__(self, client):
47-
super().__init__()
48-
self.client = client
49-
self.passed = False
50-
51-
def run(self):
52-
self.client.db.command("ping")
53-
self.passed = True # No exception raised.
54-
else:
43+
if not _IS_SYNC:
5544

5645
class SimpleOp:
5746
def __init__(self, client):
@@ -68,6 +57,17 @@ def start(self):
6857

6958
async def join(self):
7059
await self.task
60+
else:
61+
62+
class SimpleOp(threading.Thread):
63+
def __init__(self, client):
64+
super().__init__()
65+
self.client = client
66+
self.passed = False
67+
68+
def run(self):
69+
self.client.db.command("ping")
70+
self.passed = True # No exception raised.
7171

7272

7373
async def do_simple_op(client, nthreads):

test/test_mongos_load_balancing.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,35 @@ def setUpModule():
4040
pass
4141

4242

43-
if _IS_SYNC:
43+
if not _IS_SYNC:
4444

45-
class SimpleOp(threading.Thread):
45+
class SimpleOp:
4646
def __init__(self, client):
47-
super().__init__()
47+
self.task: asyncio.Task
4848
self.client = client
4949
self.passed = False
5050

5151
def run(self):
5252
self.client.db.command("ping")
5353
self.passed = True # No exception raised.
54+
55+
def start(self):
56+
self.task = asyncio.create_task(self.run())
57+
58+
def join(self):
59+
self.task
5460
else:
5561

56-
class SimpleOp:
62+
class SimpleOp(threading.Thread):
5763
def __init__(self, client):
58-
self.task: asyncio.Task
64+
super().__init__()
5965
self.client = client
6066
self.passed = False
6167

6268
def run(self):
6369
self.client.db.command("ping")
6470
self.passed = True # No exception raised.
6571

66-
def start(self):
67-
self.task = asyncio.create_task(self.run())
68-
69-
def join(self):
70-
self.task
71-
7272

7373
def do_simple_op(client, nthreads):
7474
threads = [SimpleOp(client) for _ in range(nthreads)]

0 commit comments

Comments
 (0)