File tree Expand file tree Collapse file tree 4 files changed +48
-23
lines changed
src/frequenz/sdk/microgrid Expand file tree Collapse file tree 4 files changed +48
-23
lines changed Original file line number Diff line number Diff line change @@ -495,8 +495,14 @@ async def _stop(self) -> None:
495
495
if self ._resampling_actor :
496
496
await self ._resampling_actor .actor .stop ()
497
497
await self ._battery_power_wrapper .stop ()
498
+ await self ._ev_power_wrapper .stop ()
499
+ await self ._pv_power_wrapper .stop ()
498
500
for pool in self ._battery_pool_reference_stores .values ():
499
501
await pool .stop ()
502
+ for evpool in self ._ev_charger_pool_reference_stores .values ():
503
+ await evpool .stop ()
504
+ for pvpool in self ._pv_pool_reference_stores .values ():
505
+ await pvpool .stop ()
500
506
501
507
502
508
_DATA_PIPELINE : _DataPipeline | None = None
Original file line number Diff line number Diff line change @@ -71,19 +71,20 @@ async def mocks(mocker: MockerFixture) -> typing.AsyncIterator[Mocks]:
71
71
dp = microgrid ._data_pipeline ._DATA_PIPELINE
72
72
assert dp is not None
73
73
74
- yield Mocks (
75
- mockgrid ,
76
- streamer ,
77
- dp ._battery_power_wrapper .status_channel .new_sender (),
78
- )
79
-
80
- await asyncio .gather (
81
- * [
82
- dp ._stop (),
83
- streamer .stop (),
84
- mockgrid .cleanup (),
85
- ]
86
- )
74
+ try :
75
+ yield Mocks (
76
+ mockgrid ,
77
+ streamer ,
78
+ dp ._battery_power_wrapper .status_channel .new_sender (),
79
+ )
80
+ finally :
81
+ _ = await asyncio .gather (
82
+ * [
83
+ dp ._stop (),
84
+ streamer .stop (),
85
+ mockgrid .cleanup (),
86
+ ]
87
+ )
87
88
88
89
89
90
class TestBatteryPoolControl :
Original file line number Diff line number Diff line change @@ -57,11 +57,20 @@ async def mocks(mocker: MockerFixture) -> typing.AsyncIterator[_Mocks]:
57
57
58
58
dp = typing .cast (_DataPipeline , microgrid ._data_pipeline ._DATA_PIPELINE )
59
59
60
- yield _Mocks (
61
- mockgrid ,
62
- streamer ,
63
- dp ._ev_power_wrapper .status_channel .new_sender (),
64
- )
60
+ try :
61
+ yield _Mocks (
62
+ mockgrid ,
63
+ streamer ,
64
+ dp ._ev_power_wrapper .status_channel .new_sender (),
65
+ )
66
+ finally :
67
+ _ = await asyncio .gather (
68
+ * [
69
+ dp ._stop (),
70
+ streamer .stop (),
71
+ mockgrid .cleanup (),
72
+ ]
73
+ )
65
74
66
75
67
76
class TestEVChargerPoolControl :
Original file line number Diff line number Diff line change @@ -50,11 +50,20 @@ async def mocks(mocker: MockerFixture) -> typing.AsyncIterator[_Mocks]:
50
50
51
51
dp = typing .cast (_DataPipeline , microgrid ._data_pipeline ._DATA_PIPELINE )
52
52
53
- yield _Mocks (
54
- mockgrid ,
55
- streamer ,
56
- dp ._pv_power_wrapper .status_channel .new_sender (),
57
- )
53
+ try :
54
+ yield _Mocks (
55
+ mockgrid ,
56
+ streamer ,
57
+ dp ._pv_power_wrapper .status_channel .new_sender (),
58
+ )
59
+ finally :
60
+ _ = await asyncio .gather (
61
+ * [
62
+ dp ._stop (),
63
+ streamer .stop (),
64
+ mockgrid .cleanup (),
65
+ ]
66
+ )
58
67
59
68
60
69
class TestPVPoolControl :
You can’t perform that action at this time.
0 commit comments