Commit f58420b
committed
test: fix false positive in Microvm.kill check for correct pid
In Microvm.kill() we have a sanity check for ensuring the firecracker
process wrote the correct pid to its pidfile: We ps | grep for the
jailer id of the supposedly dead firecracker process and see if any
process that has "fircracker" somewhere in its argv is using it (with
the somewhat reasonable assumption that this would be exactly the
firecracker process we just tried to kill). Howver, if the firecracker
process isnt daemonized, then we spawn it under `screen`, and now we
have two processes that contain both the jailer id and the name
"firecracker" in its argv, because screen fork()s into firecracker in
this case. Now if we kill firecracker, screen might stick around a bit
longer (because we only explicitly wait for firecracker to terminate),
and the sanity check might incorrectly pick up the screen process as a
firecracker process and cause a spurious test failure.
Fix this by having the check explicitly ignore all screen processes.
Signed-off-by: Patrick Roy <[email protected]>1 parent dc21c45 commit f58420b
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
| 343 | + | |
343 | 344 | | |
344 | 345 | | |
345 | 346 | | |
| |||
0 commit comments