From 63db4bca2987bbe55591d01f153debb27a069a1e Mon Sep 17 00:00:00 2001 From: centra Date: Tue, 17 Feb 2026 17:50:29 +0900 Subject: [PATCH] Fix test: handle race condition in SIGKILL test --- lab/test-resource-guard.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lab/test-resource-guard.nix b/lab/test-resource-guard.nix index 3c09eb7..727ff75 100644 --- a/lab/test-resource-guard.nix +++ b/lab/test-resource-guard.nix @@ -215,7 +215,8 @@ in print("Sending SIGKILL to agent...") pid = client.succeed("pgrep -f 'lightscale-client.*agent.*guard' | head -1").strip() print(f" Agent PID: {pid}") - client.succeed(f"kill -9 {pid}") + # Use execute to allow for race condition where process exits quickly + client.execute(f"kill -9 {pid} 2>/dev/null || true") time.sleep(3) # Verify the agent is dead