Skip to content

Commit bf893b6

Browse files
committed
test: only print uffd hint if uffd actually in use
If we fail to kill firecracker because it already die, we print a hint about the uffd handler being potentially responsible. But this only makes sense if a uffd handler was actually spawned, so restrict printing of the hint to this case. While we're at it, also print the uffd logs in this case, so that the truth of the hint can easily be verified (uffd killed firecracker iff uffd panicked). Signed-off-by: Patrick Roy <[email protected]>
1 parent 55a84be commit bf893b6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/framework/microvm.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,14 @@ def kill(self):
313313
if self.screen_pid:
314314
os.kill(self.screen_pid, signal.SIGKILL)
315315
except:
316-
LOG.error(
317-
"Failed to kill Firecracker Process. Did it already die (or did the UFFD handler process die and take it down)?"
318-
)
319-
LOG.error(self.log_data)
316+
if self.uffd_handler:
317+
LOG.error(
318+
"Failed to kill Firecracker Process. Did it already die (or did the UFFD handler process die and take it down)?"
319+
)
320+
LOG.error("UFFD Handler Logs:\n" + self.uffd_handler.log_data)
321+
else:
322+
LOG.error("Failed to kill Firecracker Process. Did it already die?")
323+
LOG.error("Firecracker Logs:\n" + self.log_data)
320324
raise
321325

322326
# if microvm was spawned then check if it gets killed

0 commit comments

Comments
 (0)