Skip to content

Commit 0316963

Browse files
committed
Improve cleanup of un-awaited coroutines in MockMicrogrid
The coros and tasks can all be removed as soon as the benchmark scripts have their own framework, this is just until that point. Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 2c7d254 commit 0316963

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/timeseries/mock_microgrid.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ async def cleanup(self) -> None:
440440
if _data_pipeline._DATA_PIPELINE:
441441
await _data_pipeline._DATA_PIPELINE._stop()
442442

443+
for coro in self._streaming_coros:
444+
coro.close()
445+
443446
for task in self._streaming_tasks:
444447
await cancel_and_await(task)
445448
microgrid.connection_manager._CONNECTION_MANAGER = None

0 commit comments

Comments
 (0)