Skip to content

Commit

Permalink
Merge pull request #16129 from edsantiago/fix-16075
Browse files Browse the repository at this point in the history
system tests: health-on-failure: fix broken logic
  • Loading branch information
openshift-merge-robot authored Oct 12, 2022
2 parents 1db0735 + f16e9ac commit 2a9df07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/system/250-systemd.bats
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ LISTEN_FDNAMES=listen_fdnames" | sort)
img="healthcheck_i"
_build_health_check_image $img

cname=$(random_string)
cname=c_$(random_string)
run_podman create --name $cname \
--health-cmd /healthcheck \
--health-on-failure=kill \
Expand Down Expand Up @@ -345,7 +345,11 @@ LISTEN_FDNAMES=listen_fdnames" | sort)
# Wait at most 10 seconds for the service to be restarted
local timeout=10
while [[ $timeout -gt 1 ]]; do
run_podman '?' container inspect $cname
# Possible outcomes:
# - status 0, old container is still terminating: sleep and retry
# - status 0, new CID: yay, break
# - status 1, container not found: sleep and retry
run_podman '?' container inspect $cname --format '{{.ID}}'
if [[ $status == 0 ]]; then
if [[ "$output" != "$oldID" ]]; then
break
Expand Down

0 comments on commit 2a9df07

Please sign in to comment.