CI: try to fix more flakes
Most of them look like our usual "assume too much about run -d". One of them is just an unexpected warning, a push retry. Remove the ExitCleanly() from that test, just rely on Exit(0). The other two have to do with podman logs, which we know can lag. Add a short 1-second retry loop. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
parent
7f9f384c8a
commit
39851a0b98
|
|
@ -597,7 +597,8 @@ RUN touch /file
|
||||||
|
|
||||||
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "--format=v2s2", "localhost:" + registry.Port + "/citest:latest"})
|
push := podmanTest.Podman([]string{"push", "-q", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "--format=v2s2", "localhost:" + registry.Port + "/citest:latest"})
|
||||||
push.WaitWithDefaultTimeout()
|
push.WaitWithDefaultTimeout()
|
||||||
Expect(push).Should(ExitCleanly())
|
// Cannot ExitCleanly() because this sometimes warns "Failed, retrying in 1s"
|
||||||
|
Expect(push).Should(Exit(0))
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"manifest", "add", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/citest:latest"})
|
session = podmanTest.Podman([]string{"manifest", "add", "--tls-verify=false", "--creds=" + registry.User + ":" + registry.Password, "foo", "localhost:" + registry.Port + "/citest:latest"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,19 @@ function teardown() {
|
||||||
is "$output" "running:true:false:false" \
|
is "$output" "running:true:false:false" \
|
||||||
"State. Status:Running:Pause:Checkpointed"
|
"State. Status:Running:Pause:Checkpointed"
|
||||||
|
|
||||||
# Pause briefly to let restarted container emit some output
|
# Re-fetch logs, and ensure that they continue growing.
|
||||||
sleep 0.3
|
# Allow a short while for container process to actually restart.
|
||||||
|
local retries=10
|
||||||
# Get full logs, and make sure something changed
|
while [[ $retries -gt 0 ]]; do
|
||||||
run_podman logs $cid
|
run_podman logs $cid
|
||||||
local nlines_after="${#lines[*]}"
|
local nlines_after="${#lines[*]}"
|
||||||
assert $nlines_after -gt $nlines_before \
|
if [[ $nlines_after -gt $nlines_before ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
retries=$((retries - 1))
|
||||||
|
done
|
||||||
|
assert "$retries" -gt 0 \
|
||||||
"Container failed to output new lines after first restore"
|
"Container failed to output new lines after first restore"
|
||||||
|
|
||||||
# Same thing again: test for https://github.com/containers/crun/issues/756
|
# Same thing again: test for https://github.com/containers/crun/issues/756
|
||||||
|
|
@ -83,12 +89,18 @@ function teardown() {
|
||||||
nlines_before="${#lines[*]}"
|
nlines_before="${#lines[*]}"
|
||||||
run_podman container restore $cid
|
run_podman container restore $cid
|
||||||
|
|
||||||
# Give container time to write new output; then confirm that something
|
# Same as above, confirm that we get new output
|
||||||
# was emitted
|
retries=10
|
||||||
sleep 0.3
|
while [[ $retries -gt 0 ]]; do
|
||||||
run_podman container logs $cid
|
run_podman logs $cid
|
||||||
nlines_after="${#lines[*]}"
|
local nlines_after="${#lines[*]}"
|
||||||
assert $nlines_after -gt $nlines_before \
|
if [[ $nlines_after -gt $nlines_before ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
retries=$((retries - 1))
|
||||||
|
done
|
||||||
|
assert "$retries" -gt 0 \
|
||||||
"stdout went away after second restore (crun issue 756)"
|
"stdout went away after second restore (crun issue 756)"
|
||||||
|
|
||||||
run_podman rm -t 0 -f $cid
|
run_podman rm -t 0 -f $cid
|
||||||
|
|
|
||||||
|
|
@ -769,9 +769,16 @@ EOF
|
||||||
CONTAINERS_CONF_OVERRIDE="$containersConf" run_podman kube play $YAML
|
CONTAINERS_CONF_OVERRIDE="$containersConf" run_podman kube play $YAML
|
||||||
run_podman container inspect --format '{{ .Config.Umask }}' $ctrInPod
|
run_podman container inspect --format '{{ .Config.Umask }}' $ctrInPod
|
||||||
is "${output}" "0472"
|
is "${output}" "0472"
|
||||||
# Confirm that umask actually takes effect
|
# Confirm that umask actually takes effect. Might take a second or so.
|
||||||
|
local retries=10
|
||||||
|
while [[ $retries -gt 0 ]]; do
|
||||||
run_podman logs $ctrInPod
|
run_podman logs $ctrInPod
|
||||||
is "$output" "204" "stat() on created file"
|
test -n "$output" && break
|
||||||
|
sleep 0.1
|
||||||
|
retries=$((retries - 1))
|
||||||
|
done
|
||||||
|
assert "$retries" -gt 0 "Timed out waiting for container output"
|
||||||
|
assert "$output" = "204" "stat() on created file"
|
||||||
|
|
||||||
run_podman kube down $YAML
|
run_podman kube down $YAML
|
||||||
run_podman pod rm -a
|
run_podman pod rm -a
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue