Skip to content

Commit

Permalink
test: Attach criu dump log on checkpoint failures
Browse files Browse the repository at this point in the history
Occasionally, `crun checkpoint` fails in Fedora 41 podman upstream PRs
(in revdeps tests). This isn't otherwise reproducible,  so start with
collecting all information. The journal just says "Please check
CRIU logfile", so let's collect that.
  • Loading branch information
martinpitt committed Oct 14, 2024
1 parent a1163ce commit fe1494d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -1539,11 +1539,19 @@ class TestApplication(testlib.MachineCase):
b.wait_not_present(".pf-v5-c-modal-box")

if self.has_criu:
b.wait(lambda: self.getContainerAttr("swamped-crate", "State") in NOT_RUNNING)
b.wait_text(
f'#containers-containers tr:contains("{IMG_BUSYBOX}") dt:contains("Latest checkpoint") + dd',
'less than a minute ago'
)
try:
b.wait(lambda: self.getContainerAttr("swamped-crate", "State") in NOT_RUNNING)
b.wait_text(
f'#containers-containers tr:contains("{IMG_BUSYBOX}") dt:contains("Latest checkpoint") + dd',
'less than a minute ago'
)
except testlib.Error:
# dump.log may help with debugging criu failures
attachment = self.label() + "-dump.log"
dump_log = m.execute("find /var/lib/containers -name dump.log").strip()
m.download(dump_log, attachment, ".")
testlib.attach(attachment, move=True)
raise
else:
# expect proper error message
b.wait_in_text(".pf-v5-c-alert.pf-m-danger", "Failed to checkpoint container swamped-crate")
Expand Down

0 comments on commit fe1494d

Please sign in to comment.