aboutsummaryrefslogtreecommitdiff
path: root/test/system/070-build.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-08-19 07:28:10 -0600
committerEd Santiago <santiago@redhat.com>2019-08-19 08:05:33 -0600
commitcb4804de388c6c3a1b7358b83d81af1921b579d2 (patch)
treed814d2708e7803e053a1d9fdd39f7aadc422e7ad /test/system/070-build.bats
parentbd0b05f13860b62de389ec67eadd0df6b44d4f4f (diff)
downloadpodman-cb4804de388c6c3a1b7358b83d81af1921b579d2.tar.gz
podman-cb4804de388c6c3a1b7358b83d81af1921b579d2.tar.bz2
podman-cb4804de388c6c3a1b7358b83d81af1921b579d2.zip
Flake fix: build test timeout
The priv test added to the build test in June runs an 'apk' command which, unavoidably, has to fetch stuff from the net. This is slow and unreliable, and periodically leads to timeout failures. Worse, when this happens, some sort of invisible buildah-only container gets left behind that leads to failures in subsequent tests when trying to reset to known state. Imperfect workaround: try a 240-second timeout (up from 60) when running apk. As backup, add a custom teardown() which attempts to force-remove all containers and any new images. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/070-build.bats')
-rw-r--r--test/system/070-build.bats16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index 5ef84e9b8..a9d2ed1b7 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -22,12 +22,24 @@ RUN apk add nginx
RUN echo $rand_content > /$rand_filename
EOF
- run_podman build -t build_test --format=docker $tmpdir
+ # The 'apk' command can take a long time to fetch files; bump timeout
+ PODMAN_TIMEOUT=240 run_podman build -t build_test --format=docker $tmpdir
is "$output" ".*STEP 4: COMMIT" "COMMIT seen in log"
run_podman run --rm build_test cat /$rand_filename
is "$output" "$rand_content" "reading generated file in image"
- run_podman rmi build_test
+ run_podman rmi -f build_test
}
+
+function teardown() {
+ # A timeout or other error in 'build' can leave behind stale images
+ # that podman can't even see and which will cascade into subsequent
+ # test failures. Try a last-ditch force-rm in cleanup, ignoring errors.
+ run_podman '?' rm -a -f
+ run_podman '?' rmi -f build_test
+
+ basic_teardown
+}
+
# vim: filetype=sh