mirror of
https://github.com/containers/podman.git
synced 2025-05-21 17:16:22 +08:00
system tests: fix flake waiting for container to run
I have seen some system tests flake waiting for a container to transition into a specific running state. My theory is that the waiting time was not sufficient on nodes under high load. Hence, increase the waiting time. Also replace the break with a return to spare some cycles to redundantly compare with the already checked state. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -397,25 +397,25 @@ function _ensure_pod_state() {
|
|||||||
for i in {0..5}; do
|
for i in {0..5}; do
|
||||||
run_podman pod inspect $1 --format "{{.State}}"
|
run_podman pod inspect $1 --format "{{.State}}"
|
||||||
if [[ $output == "$2" ]]; then
|
if [[ $output == "$2" ]]; then
|
||||||
break
|
return
|
||||||
fi
|
fi
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
done
|
done
|
||||||
|
|
||||||
is "$output" "$2" "unexpected pod state"
|
die "Timed out waiting for pod $1 to enter state $2"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Wait for the container's (1st arg) running state (2nd arg)
|
# Wait for the container's (1st arg) running state (2nd arg)
|
||||||
function _ensure_container_running() {
|
function _ensure_container_running() {
|
||||||
for i in {0..5}; do
|
for i in {0..20}; do
|
||||||
run_podman container inspect $1 --format "{{.State.Running}}"
|
run_podman container inspect $1 --format "{{.State.Running}}"
|
||||||
if [[ $output == "$2" ]]; then
|
if [[ $output == "$2" ]]; then
|
||||||
break
|
return
|
||||||
fi
|
fi
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
done
|
done
|
||||||
|
|
||||||
is "$output" "$2" "unexpected pod state"
|
die "Timed out waiting for container $1 to enter state running=$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
|
Reference in New Issue
Block a user