Skip to content

Commit 342a07b

Browse files
committed
fix(test): eliminate false positives from is-microvm-dead check
Ensure that `ps(1)` does not truncate the command, which might result in the grep failing (if the jailer_id gets truncated), using the -ww option. While we're at it, also use -o cmd so that ps only prints the command names and nothing else (as we're not using anything else from this output). This causes false-positives instead of false-negatives funnily enough, because we're using check_output, meaning if the grep doesnt find anything we fail the command (in the "everything works" scenario, firecracker is dead but grep still matches the "ps | grep" process itself). Signed-off-by: Patrick Roy <[email protected]>
1 parent 2c3bb5f commit 342a07b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/framework/microvm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def kill(self):
330330

331331
# filter ps results for the jailer's unique id
332332
_, stdout, stderr = utils.check_output(
333-
f"ps aux | grep {self.jailer.jailer_id}"
333+
f"ps ax -o cmd -ww | grep {self.jailer.jailer_id}"
334334
)
335335
# make sure firecracker was killed
336336
assert (

0 commit comments

Comments
 (0)