diff --git a/tests/epics/adcore/test_drivers.py b/tests/epics/adcore/test_drivers.py index 6d6cddd199..2fe67c3df5 100644 --- a/tests/epics/adcore/test_drivers.py +++ b/tests/epics/adcore/test_drivers.py @@ -70,7 +70,7 @@ async def test_start_acquiring_driver_and_ensure_status_flags_immediate_failure( ): set_mock_value(driver.detector_state, adcore.DetectorState.Error) acquiring = await adcore.start_acquiring_driver_and_ensure_status( - driver, timeout=0.01 + driver, timeout=0.05 ) with pytest.raises(ValueError): await acquiring diff --git a/tests/epics/demo/test_demo.py b/tests/epics/demo/test_demo.py index e29e13bf29..7ab6c27d9b 100644 --- a/tests/epics/demo/test_demo.py +++ b/tests/epics/demo/test_demo.py @@ -19,13 +19,10 @@ get_mock, get_mock_put, set_mock_value, + wait_for_pending_wakeups, ) from ophyd_async.epics import demo -# Long enough for multiple asyncio event loop cycles to run so -# all the tasks have a chance to run -A_WHILE = 0.001 - @pytest.fixture async def mock_mover() -> demo.Mover: @@ -141,7 +138,7 @@ async def test_mover_moving_well(mock_mover: demo.Mover) -> None: time_elapsed=pytest.approx(0.1, abs=0.05), ) set_mock_value(mock_mover.readback, 0.5499999) - await asyncio.sleep(A_WHILE) + await wait_for_pending_wakeups() assert s.done assert s.success done.assert_called_once_with(s)