-
Type:
Build Failure
-
Resolution: Done
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Python Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Name of Failure:
test.asynchronous.test_concurrency.TestAsyncConcurrency.test_concurrency
Link to task:
Context of when and why the failure occurred:
test.asynchronous.test_concurrency.TestAsyncConcurrency.test_concurrency is inconsistent across platforms and host conditions. Its threshold should be lowered to ensure that failures represent code slowdowns and not platform variance.
Stack trace:
[2025/04/15 16:32:19.963] FAILURE: AssertionError: 51.85073760991477 not greater than or equal to 75 () [2025/04/15 16:32:19.963] self = <test.asynchronous.test_concurrency.TestAsyncConcurrency testMethod=test_concurrency> [2025/04/15 16:32:19.963] async def test_concurrency(self): [2025/04/15 16:32:19.963] tasks = [] [2025/04/15 16:32:19.963] iterations = 5 [2025/04/15 16:32:19.963] [2025/04/15 16:32:19.963] client = await self.async_single_client() [2025/04/15 16:32:19.963] await client.db.test.drop() [2025/04/15 16:32:19.963] await client.db.test.insert_one({"x": 1}) [2025/04/15 16:32:19.963] [2025/04/15 16:32:19.963] start = time.time() [2025/04/15 16:32:19.963] [2025/04/15 16:32:19.963] for _ in range(iterations): [2025/04/15 16:32:19.963] await self._task(client) [2025/04/15 16:32:19.963] [2025/04/15 16:32:19.963] sequential_time = time.time() - start [2025/04/15 16:32:19.963] start = time.time() [2025/04/15 16:32:19.963] [2025/04/15 16:32:19.963] for i in range(iterations): [2025/04/15 16:32:19.963] tasks.append(self._task(client)) [2025/04/15 16:32:19.963] [2025/04/15 16:32:19.963] await asyncio.gather(*tasks) [2025/04/15 16:32:19.963] concurrent_time = time.time() - start [2025/04/15 16:32:19.963] [2025/04/15 16:32:19.963] percent_faster = (sequential_time - concurrent_time) / concurrent_time * 100 [2025/04/15 16:32:19.963] # We expect the concurrent tasks to be at least 75% faster on all platforms as a conservative benchmark [2025/04/15 16:32:19.963] > self.assertGreaterEqual(percent_faster, 75) [2025/04/15 16:32:19.963] E AssertionError: 51.85073760991477 not greater than or equal to 75 [2025/04/15 16:32:19.963] test/asynchronous/test_concurrency.py:54: AssertionError