Fix test: handle race condition in SIGKILL test

This commit is contained in:
centra 2026-02-17 17:50:29 +09:00
parent de17c4c84e
commit 63db4bca29
Signed by: centra
GPG key ID: 0C09689D20B25ACA

View file

@ -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