Skip to content

Commit

Permalink
CI: e2e: add delay before podman logs or journalctl
Browse files Browse the repository at this point in the history
...to reduce flakes.

Reason: journald makes no guarantees. Just because a systemd job
has finished, or podman has written+flushed log entries, doesn't
mean that journald will actually know about them:

   systemd/systemd#28650

Workaround: wrap some podman-logs tests inside Eventually()
so they will be retried when log == journald

This addresses, but does not close, containers#18501. That's a firehose,
with many more failures than I can possibly cross-reference.
I will leave it open, then keep monitoring missing-logs flakes
over time, and pick those off as they occur.

Signed-off-by: Ed Santiago <santiago@redhat.com>
  • Loading branch information
edsantiago committed Aug 7, 2023
1 parent f6c2be9 commit 25c0628
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 101 deletions.
3 changes: 3 additions & 0 deletions test/e2e/containers_conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os/exec"
"path/filepath"
"strings"
"time"

"github.com/containers/podman/v4/libpod/define"
. "github.com/containers/podman/v4/test/utils"
Expand Down Expand Up @@ -254,6 +255,8 @@ var _ = Describe("Verify podman containers.conf usage", func() {
wait.WaitWithDefaultTimeout()
Expect(wait).Should(Exit(0))

// Flake prevention: journalctl makes no timeliness guarantees.
time.Sleep(1 * time.Second)
cmd := exec.Command("journalctl", "--no-pager", "-o", "json", "--output-fields=CONTAINER_TAG", fmt.Sprintf("CONTAINER_ID_FULL=%s", cid))
out, err := cmd.CombinedOutput()
Expect(err).ToNot(HaveOccurred())
Expand Down
Loading

0 comments on commit 25c0628

Please sign in to comment.