diff --git a/tests/core/test_dragon.py b/tests/core/test_dragon.py index a3743885..6b928736 100644 --- a/tests/core/test_dragon.py +++ b/tests/core/test_dragon.py @@ -415,7 +415,10 @@ def require_client(pid): "cuphoton.core.mps", SimpleNamespace(require_mps_client=require_client), ) - result = _run(tmp_path, mps_pipe_directory=pipe_directory) + # Check MPS initialization ordering without a short filesystem deadline. + result = _run( + tmp_path, mps_pipe_directory=pipe_directory, result_timeout=5.0 + ) assert len(checked) == 2 assert result.status == ("success" if connected else "failed") assert sorted(state.closed) == [0, 1] diff --git a/tests/xlens/test_nooa_backend.py b/tests/xlens/test_nooa_backend.py index dab66d9d..12b3653f 100644 --- a/tests/xlens/test_nooa_backend.py +++ b/tests/xlens/test_nooa_backend.py @@ -398,12 +398,17 @@ async def request(payload): await asyncio.Event().wait() return response("execute_python", {"code": "while True: pass"}) - task = asyncio.create_task(run(request, timeout_seconds=8)) + task = asyncio.create_task( + run(request, timeout_seconds=60 if cancel else 8) + ) if cancel: - await asyncio.wait_for(entered.wait(), 7) - task.cancel() - with pytest.raises(asyncio.CancelledError): - await bounded(task, processes) + try: + # Worker imports must finish before testing cancellation. + await asyncio.wait_for(entered.wait(), 30) + finally: + task.cancel() + with pytest.raises(asyncio.CancelledError): + await bounded(task, processes) else: with pytest.raises(backend.NooaError, match="deadline"): await bounded(task, processes)