diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-24 18:13:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-24 18:13:46 +0100 |
commit | 477a9cdb9dc426e8aafeb6e98b44b721555c451f (patch) | |
tree | d74fdfd46a69c001cba4600b6807852d31fde6cb /test | |
parent | 0556a080ca536abad6ff018872a92e305cad0d44 (diff) | |
parent | 44936c14961ac7bdc033ece1a0ee11d293446cc1 (diff) | |
download | podman-477a9cdb9dc426e8aafeb6e98b44b721555c451f.tar.gz podman-477a9cdb9dc426e8aafeb6e98b44b721555c451f.tar.bz2 podman-477a9cdb9dc426e8aafeb6e98b44b721555c451f.zip |
Merge pull request #13630 from flouthoc/backport-race-build-v4.0
[v4.0 backport] 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.bats | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/system/070-build.bats b/test/system/070-build.bats index c963d8325..94256b215 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -210,6 +210,32 @@ 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. + for i in $(seq --format 'i%02g' 1 $count); do + run_podman rmi $i + done +} + @test "podman build - URLs" { tmpdir=$PODMAN_TMPDIR/build-test mkdir -p $tmpdir |