Skip to content

Commit

Permalink
Merge pull request #19008 from Luap99/800lines-flake
Browse files Browse the repository at this point in the history
debug tail 800 lines flake
  • Loading branch information
openshift-merge-robot authored Jun 27, 2023
2 parents 3794d06 + 2160a11 commit 4445a50
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/e2e/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/containers/storage/pkg/stringid"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/format"
. "github.com/onsi/gomega/gexec"
)

Expand Down Expand Up @@ -117,6 +118,16 @@ var _ = Describe("Podman logs", func() {
It("tail 800 lines: "+log, func() {
skipIfJournaldInContainer()

// we match 800 line array here, make sure to print all lines when assertion fails.
// There is something weird going on (https://github.com/containers/podman/issues/18501)
// and only the normal output log does not seem to be enough to figure out why it flakes.
oldLength := format.MaxLength
// unlimited matcher output
format.MaxLength = 0
defer func() {
format.MaxLength = oldLength
}()

// this uses -d so that we do not have 1000 unnecessary lines printed in every test log
logc := podmanTest.Podman([]string{"run", "--log-driver", log, "-d", ALPINE, "sh", "-c", "i=1; while [ \"$i\" -ne 1000 ]; do echo \"line $i\"; i=$((i + 1)); done"})
logc.WaitWithDefaultTimeout()
Expand Down

0 comments on commit 4445a50

Please sign in to comment.