Skip to content

Commit

Permalink
test: add a test to verify race free concurrent/parallel builds
Browse files Browse the repository at this point in the history
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 containers#13339

Co-authored-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
  • Loading branch information
flouthoc and edsantiago committed Mar 3, 2022
1 parent 410d286 commit 2b7c5ca
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/system/070-build.bats
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,30 @@ EOF
run_podman rmi -f build_test
}

@test "podman parallel build should not race" {
# Start thirty builds in parallel
local count=30
local -a pids
for i in $(seq --format '%02g' 1 $count); do
local d=$PODMAN_TMPDIR/build-test$i
mkdir $d
cat >$d/Containerfile <<EOF
FROM $IMAGE
RUN echo hi
EOF
$PODMAN build -t i$i $d &>/dev/null &
done

# DANGER DANGER DANGER: this has the potential to hang forever,
# should any individual build fail. I can find no way to add a timeout.
wait

# Now delete each image. If an image wasn't built, rmi will fail
for i in $(seq --format '%02g' 1 $count); do
run_podman rmi i$i
done
}

@test "podman build - URLs" {
tmpdir=$PODMAN_TMPDIR/build-test
mkdir -p $tmpdir
Expand Down

0 comments on commit 2b7c5ca

Please sign in to comment.