Skip to content

The agent that grows with you

test(uninstall): close the loop in finally so a failing run does not leak it

Tekniume8d71ed671f6
diff --git a/tests/hermes_cli/test_data_uninstall_holders.py b/tests/hermes_cli/test_data_uninstall_holders.py
index 75df4d2971a..a644e5a9e04 100644
--- a/tests/hermes_cli/test_data_uninstall_holders.py
+++ b/tests/hermes_cli/test_data_uninstall_holders.py
@@ -103,8 +103,9 @@ def test_manual_gateway_drains_over_real_control_transport_before_deletion(layou
if thread.is_alive():
loop.call_soon_threadsafe(loop.stop)
thread.join(timeout=10)
+ if not thread.is_alive():
+ loop.close()
assert not thread.is_alive()
- loop.close()
@pytest.mark.parametrize("profile", ["", "sibling"])