mirror of
https://github.com/run-llama/workflows-py.git
synced 2026-07-18 08:05:35 -04:00
df71952c80
The `IdleReleaseDecorator.destroy()` and `PersistenceDecorator.destroy()` methods spawned or referenced background tasks (`_deferred_release`, `_on_server_stop`, `resume_task`) but returned before those tasks completed. With the module-scoped event loop used by the tests, those orphaned tasks could still be running on a subsequent test's loop, which made `test_multistep_hitl_multiple_restarts_at_same_wait_point` intermittently fail when a stale idle-release task raced the new server. Cancel and await all pending background tasks during destroy so shutdown is synchronous by the time the context manager exits. Tighten the related destroy-focused tests to assert the post-condition immediately and add a regression test that destroy() cancels in-flight deferred-release tasks.