Skip to content

Commit 0324791

Browse files
committed
refactor(test): split assertions
Split an assertion on a conjunction into multiple assertions, to make it easier to see which of the individual checks failed. Suggested-by: Babis Chalios <[email protected]> Signed-off-by: Patrick Roy <[email protected]>
1 parent f58420b commit 0324791

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/framework/microvm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,16 @@ def kill(self):
337337
f"ps ax -o pid,cmd -ww | grep {self.jailer.jailer_id}"
338338
)
339339

340+
assert not stderr, f"error querying processes using `ps`: {stderr}"
341+
340342
offenders = []
341343
for proc in stdout.splitlines():
342344
_, cmd = proc.lower().split(maxsplit=1)
343345
if "firecracker" in proc and not cmd.startswith("screen"):
344346
offenders.append(proc)
345347

346348
# make sure firecracker was killed
347-
assert not stderr and not offenders, (
349+
assert not offenders, (
348350
f"Firecracker reported its pid {self.firecracker_pid}, which was killed, but there still exist processes using the supposedly dead Firecracker's jailer_id: \n"
349351
+ "\n".join(offenders)
350352
)

0 commit comments

Comments
 (0)