From 4926556c6aa15c70b15055dd9944abf41fab3765 Mon Sep 17 00:00:00 2001 From: Aditya R Date: Wed, 6 Apr 2022 22:40:47 +0530 Subject: [PATCH] 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 containers/storage#1153 and containers/image#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: containers/buildah#3794 and #13339 Co-authored-by: Ed Santiago Signed-off-by: Aditya R --- test/system/070-build.bats | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/system/070-build.bats b/test/system/070-build.bats index 44387d4fdf1f..77610ae29ade 100644 --- a/test/system/070-build.bats +++ b/test/system/070-build.bats @@ -168,6 +168,30 @@ EOF run_podman rmi -f build_test $iid } +@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 </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