Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4.3] More log-flake work #16535

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test/e2e/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions test/system/200-pod.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 7 additions & 0 deletions test/system/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,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

Expand Down