Merge pull request #16437 from edsantiago/more_log_flakes

More log-flake work
This commit is contained in:
OpenShift Merge Robot
2022-11-08 03:17:36 -05:00
committed by GitHub
3 changed files with 13 additions and 1 deletions

View File

@ -65,7 +65,11 @@ var _ = Describe("Podman logs", func() {
Expect(logc).To(Exit(0))
cid := logc.OutputToString()
results := podmanTest.Podman([]string{"logs", cid})
results := podmanTest.Podman([]string{"wait", cid})
results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
results = podmanTest.Podman([]string{"logs", cid})
results.WaitWithDefaultTimeout()
Expect(results).To(Exit(0))
Expect(results.OutputToStringArray()).To(HaveLen(3))

View File

@ -303,6 +303,7 @@ EOF
echo "$teststring" | nc 127.0.0.1 $port_out
# Confirm that the container log output is the string we sent it.
run_podman wait $cid
run_podman logs $cid
is "$output" "$teststring" "test string received on container"

View File

@ -258,6 +258,13 @@ function wait_for_output {
if [ $output != "true" ]; then
run_podman inspect --format '{{.State.ExitCode}}' $cid
exitcode=$output
# One last chance: maybe the container exited just after logs cmd
run_podman logs $cid
if expr "$logs" : ".*$expect" >/dev/null; then
return
fi
die "Container exited (status: $exitcode) before we saw '$expect': $logs"
fi