Skip to content

Commit 663f752

Browse files
committed
test: Make system container cleanup faster
`podman system reset` defaults to waiting for 10s for containers to shut down, which unnecessarily slows down tests (see containers/podman#21874). To work around this, force-stop all containers first with a zero timeout.
1 parent 232ea86 commit 663f752

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/check-application

+8-1
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,22 @@ class TestApplication(testlib.MachineCase):
113113
# backup/restore pristine podman state, so that tests can run on existing testbeds
114114
self.restore_dir("/var/lib/containers")
115115

116-
# HACK: sometimes podman leaks mounts
117116
self.addCleanup(m.execute, """
118117
systemctl stop podman.service podman.socket
118+
119+
# HACK: system reset has 10s timeout, make that faster with an extra `stop`
120+
# https://github.com/containers/podman/issues/21874
121+
podman stop --time 0 --all
122+
podman pod stop --time 0 --all
123+
119124
systemctl reset-failed podman.service podman.socket
120125
podman system reset --force
121126
pkill -e -9 podman || true
122127
while pgrep podman; do sleep 0.1; done
123128
pkill -e -9 conmon || true
124129
while pgrep conmon; do sleep 0.1; done
130+
131+
# HACK: sometimes podman leaks mounts
125132
findmnt --list -otarget | grep /var/lib/containers/. | xargs -r umount
126133
sync
127134
""")

0 commit comments

Comments
 (0)