summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-03 12:15:19 -0500
committerGitHub <noreply@github.com>2022-03-03 12:15:19 -0500
commit3cfb70f95382066874ba6f2f5a1374d86f2af2c6 (patch)
treecd6a65b23a8ff827e7c7b7dc1336a688fc362396 /test
parented59b89a43c6d9f0bf691e536738fb8450bedfa9 (diff)
parent63f92d0a66be75280a532becce2775e9643e9ab9 (diff)
downloadpodman-3cfb70f95382066874ba6f2f5a1374d86f2af2c6.tar.gz
podman-3cfb70f95382066874ba6f2f5a1374d86f2af2c6.tar.bz2
podman-3cfb70f95382066874ba6f2f5a1374d86f2af2c6.zip
Merge pull request #13404 from flouthoc/bump-to-race-free-deps
deps: bump to race-free `c/image` and `c/storage` along with test to verify `concurrent/parallel` builds
Diffstat (limited to 'test')
-rw-r--r--test/system/070-build.bats24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats
index c963d8325..e47d66542 100644
--- a/test/system/070-build.bats
+++ b/test/system/070-build.bats
@@ -210,6 +210,30 @@ EOF
run_podman rmi -f build_test
}
+@test "podman parallel build should not race" {
+ skip_if_remote "following test is not supported for remote clients"
+
+ # Run thirty parallel builds using the same Containerfile
+ cat >$PODMAN_TMPDIR/Containerfile <<EOF
+FROM $IMAGE
+RUN echo hi
+EOF
+
+ local count=30
+ for i in $(seq --format '%02g' 1 $count); do
+ timeout --foreground -v --kill=10 60 \
+ $PODMAN build -t i$i $PODMAN_TMPDIR &>/dev/null &
+ done
+
+ # Wait for all background builds to complete. Note that this succeeds
+ # even if some of the individual builds fail! Our actual test is below.
+ wait
+
+ # Now delete all built images. If any image wasn't built, rmi will fail
+ # and test will fail.
+ run_podman rmi $(seq --format 'i%02g' 1 $count)
+}
+
@test "podman build - URLs" {
tmpdir=$PODMAN_TMPDIR/build-test
mkdir -p $tmpdir