File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 99
1010import async_solipsism
1111import pytest
12+ import time_machine
1213from pytest_mock import MockerFixture
1314
1415from frequenz .sdk .microgrid ._data_pipeline import _DataPipeline
@@ -27,7 +28,10 @@ def event_loop() -> Iterator[async_solipsism.EventLoop]:
2728 loop .close ()
2829
2930
30- async def test_actors_started (mocker : MockerFixture ) -> None :
31+ # loop time is advanced but not the system time
32+ async def test_actors_started (
33+ fake_time : time_machine .Coordinates , mocker : MockerFixture
34+ ) -> None :
3135 """Test that the datasourcing, resampling and power distributing actors are started."""
3236 datapipeline = _DataPipeline (
3337 resampler_config = ResamplerConfig (resampling_period = timedelta (seconds = 1 ))
@@ -44,6 +48,7 @@ async def test_actors_started(mocker: MockerFixture) -> None:
4448 assert datapipeline ._data_sourcing_actor is not None
4549 assert datapipeline ._data_sourcing_actor .actor is not None
4650 await asyncio .sleep (1 )
51+ fake_time .shift (timedelta (seconds = 1 ))
4752 assert datapipeline ._data_sourcing_actor .actor .is_running
4853
4954 assert datapipeline ._resampling_actor is not None
You can’t perform that action at this time.
0 commit comments