mirror of
https://github.com/containers/podman.git
synced 2025-06-30 15:38:50 +08:00
Merge pull request #16437 from edsantiago/more_log_flakes
More log-flake work
This commit is contained in:
@ -65,7 +65,11 @@ var _ = Describe("Podman logs", func() {
|
|||||||
Expect(logc).To(Exit(0))
|
Expect(logc).To(Exit(0))
|
||||||
cid := logc.OutputToString()
|
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()
|
results.WaitWithDefaultTimeout()
|
||||||
Expect(results).To(Exit(0))
|
Expect(results).To(Exit(0))
|
||||||
Expect(results.OutputToStringArray()).To(HaveLen(3))
|
Expect(results.OutputToStringArray()).To(HaveLen(3))
|
||||||
|
@ -303,6 +303,7 @@ EOF
|
|||||||
echo "$teststring" | nc 127.0.0.1 $port_out
|
echo "$teststring" | nc 127.0.0.1 $port_out
|
||||||
|
|
||||||
# Confirm that the container log output is the string we sent it.
|
# Confirm that the container log output is the string we sent it.
|
||||||
|
run_podman wait $cid
|
||||||
run_podman logs $cid
|
run_podman logs $cid
|
||||||
is "$output" "$teststring" "test string received on container"
|
is "$output" "$teststring" "test string received on container"
|
||||||
|
|
||||||
|
@ -258,6 +258,13 @@ function wait_for_output {
|
|||||||
if [ $output != "true" ]; then
|
if [ $output != "true" ]; then
|
||||||
run_podman inspect --format '{{.State.ExitCode}}' $cid
|
run_podman inspect --format '{{.State.ExitCode}}' $cid
|
||||||
exitcode=$output
|
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"
|
die "Container exited (status: $exitcode) before we saw '$expect': $logs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user