Fix test: handle race condition in SIGKILL test
This commit is contained in:
parent
de17c4c84e
commit
63db4bca29
1 changed files with 2 additions and 1 deletions
|
|
@ -215,7 +215,8 @@ in
|
||||||
print("Sending SIGKILL to agent...")
|
print("Sending SIGKILL to agent...")
|
||||||
pid = client.succeed("pgrep -f 'lightscale-client.*agent.*guard' | head -1").strip()
|
pid = client.succeed("pgrep -f 'lightscale-client.*agent.*guard' | head -1").strip()
|
||||||
print(f" Agent PID: {pid}")
|
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)
|
time.sleep(3)
|
||||||
|
|
||||||
# Verify the agent is dead
|
# Verify the agent is dead
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue