diff --git a/tests/test_connector.py b/tests/test_connector.py index 266afea42f5..5bbd42a3954 100644 --- a/tests/test_connector.py +++ b/tests/test_connector.py @@ -1144,6 +1144,7 @@ async def test_cleanup(key: Any) -> None: existing_handle = conn._cleanup_handle = mock.Mock() conn._cleanup() + await asyncio.sleep(0.1) # Mitigate race condition on slow systems assert existing_handle.cancel.called assert conn._conns == {} assert conn._cleanup_handle is None diff --git a/tests/test_loop.py b/tests/test_loop.py index 7f31677b9d8..1041685e063 100644 --- a/tests/test_loop.py +++ b/tests/test_loop.py @@ -7,14 +7,14 @@ from aiohttp import web from aiohttp.test_utils import AioHTTPTestCase, loop_context -from tests._pytest_plugin import SUPPORTS_XDIST # type: ignore[import] +# from tests._pytest_plugin import SUPPORTS_XDIST # type: ignore[import] @pytest.mark.skipif( platform.system() == "Windows", reason="the test is not valid for Windows" ) async def test_subprocess_co(loop: Any) -> None: - assert PY_38 or threading.current_thread() is threading.main_thread() or SUPPORTS_XDIST + assert PY_38 or threading.current_thread() is threading.main_thread() # or SUPPORTS_XDIST proc = await asyncio.create_subprocess_shell( "exit 0", stdin=asyncio.subprocess.DEVNULL,