From 0c0af7dd5a9d1c30820b52f8209151f0f2d5610d Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 19 Jul 2025 23:22:13 -0600 Subject: Fix a bug where inactive loops would be indexed (read desc) Cleaned up Aergia.walk_back_until_loop to only get running event loops. Previously, this manifested as a bug. The asyncio.Process class would fork off a thread, and the event loop would be found in that thread's local variables, even though that thread was not executing that event loop. This would result in get_event_loops containing duplicate values, and affected event loops would be assigned duplicate time --- t/eager_and_scheduled.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't/eager_and_scheduled.py') diff --git a/t/eager_and_scheduled.py b/t/eager_and_scheduled.py index 178a9f4..030b539 100644 --- a/t/eager_and_scheduled.py +++ b/t/eager_and_scheduled.py @@ -8,7 +8,8 @@ async def foo(): async def bar(): - await asyncio.create_subprocess_shell('sleep 1.0') + proc = await asyncio.create_subprocess_shell('sleep 1.0') + await proc.communicate() async def baz(): -- cgit v1.2.3