Skip to content

Commit 8d867d0

Browse files
committed
test: stabilize concurrency timing assertion
1 parent 14474fe commit 8d867d0

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tests/integration/test_concurrency_locks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class DelayedTransport(httpx.AsyncBaseTransport):
1414
async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
15-
await asyncio.sleep(0.1)
15+
await asyncio.sleep(0.25)
1616
return httpx.Response(200, json={"ok": True}, request=request)
1717

1818

@@ -64,5 +64,4 @@ async def test_independent_workflows_run_concurrently_and_locks_serialize(tmp_pa
6464
make_document(True), env={"USER_ID": "u1"}
6565
)
6666
locked_elapsed = time.perf_counter() - start
67-
assert concurrent_elapsed < 0.18
68-
assert locked_elapsed >= 0.19
67+
assert locked_elapsed - concurrent_elapsed >= 0.12

0 commit comments

Comments
 (0)