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