diff options
author | Aditya R <arajan@redhat.com> | 2022-03-02 18:37:16 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-03-03 21:03:35 +0530 |
commit | 63f92d0a66be75280a532becce2775e9643e9ab9 (patch) | |
tree | 977d9b7c64af881522e2096b896ae761e0e58729 /test/system | |
parent | 410d28660853437031ce027bbb7b122c1e76ad55 (diff) | |
download | podman-63f92d0a66be75280a532becce2775e9643e9ab9.tar.gz podman-63f92d0a66be75280a532becce2775e9643e9ab9.tar.bz2 podman-63f92d0a66be75280a532becce2775e9643e9ab9.zip |
test: add a test to verify race free concurrent/parallel builds
Invoking parallel/concurrent builds from podman race against each other
following behviour was fixed in
https://github.com/containers/storage/pull/1153 and https://github.com/containers/image/pull/1480
Test verifies if following bug is fixed in new race-free API or not.
Read more about this issue, see bz 2055487 for more details.
More details here: https://github.com/containers/buildah/pull/3794 and https://github.com/containers/podman/pull/13339
Co-authored-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'test/system')
-rw-r--r-- | test/system/070-build.bats | 24 |
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 |