Skip to content

Commit d554e5b

Browse files
committed
Vastly improve performance
1 parent 191f6ca commit d554e5b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/asynchronous/test_concurrency.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@
2525

2626
class TestAsyncConcurrency(AsyncIntegrationTest):
2727
async def _task(self, client):
28-
await client.db.test.find_one({"$where": delay(1)})
28+
await client.db.test.find_one({"$where": delay(0.05)})
2929

30-
# Remove once PYTHON-4636 is merged
31-
@async_client_context.require_no_tls
3230
async def test_concurrency(self):
3331
tasks = []
3432
iterations = 5
@@ -52,5 +50,5 @@ async def test_concurrency(self):
5250
concurrent_time = time.time() - start
5351

5452
percent_faster = (sequential_time - concurrent_time) / concurrent_time * 100
55-
# We expect the concurrent tasks to be at least 50% faster
56-
self.assertGreaterEqual(percent_faster, 50)
53+
# We expect the concurrent tasks to be at least twice as fast
54+
self.assertGreaterEqual(percent_faster, 100)

0 commit comments

Comments
 (0)