diff --git a/cmd/nerdctl/builder_build_test.go b/cmd/nerdctl/builder_build_test.go index 59b25d7fc42..472d93b2495 100644 --- a/cmd/nerdctl/builder_build_test.go +++ b/cmd/nerdctl/builder_build_test.go @@ -152,7 +152,6 @@ CMD ["cat", "/hello2"] } func TestBuildFromStdin(t *testing.T) { - t.Parallel() testutil.RequiresBuild(t) base := testutil.NewBase(t) defer base.Cmd("builder", "prune").Run() @@ -199,7 +198,6 @@ CMD ["echo", "nerdctl-build-test-dockerfile"] } func TestBuildLocal(t *testing.T) { - t.Parallel() testutil.RequiresBuild(t) base := testutil.NewBase(t) if testutil.GetTarget() == testutil.Docker { @@ -293,7 +291,6 @@ CMD echo $TEST_STRING } func TestBuildWithIIDFile(t *testing.T) { - t.Parallel() testutil.RequiresBuild(t) base := testutil.NewBase(t) defer base.Cmd("builder", "prune").Run() @@ -318,7 +315,6 @@ CMD ["echo", "nerdctl-build-test-string"] } func TestBuildWithLabels(t *testing.T) { - t.Parallel() testutil.RequiresBuild(t) base := testutil.NewBase(t) defer base.Cmd("builder", "prune").Run() @@ -547,7 +543,6 @@ func buildWithNamedBuilder(base *testutil.Base, builderName string, args ...stri } func TestBuildAttestation(t *testing.T) { - t.Parallel() testutil.RequiresBuild(t) base := testutil.NewBase(t) builderName := testutil.Identifier(t) diff --git a/cmd/nerdctl/container_logs_test.go b/cmd/nerdctl/container_logs_test.go index 944b48486d2..ac036e74c52 100644 --- a/cmd/nerdctl/container_logs_test.go +++ b/cmd/nerdctl/container_logs_test.go @@ -209,7 +209,7 @@ func TestLogsWithForegroundContainers(t *testing.T) { } func TestTailFollowRotateLogs(t *testing.T) { - // FIXME this is flaky by nature... 5 lines is arbitrary, 2000 ms is arbitrary, and both are some sort of educated + // FIXME this is flaky by nature... 2 lines is arbitrary, 10000 ms is arbitrary, and both are some sort of educated // guess that things will mostly always kinda work maybe... // Furthermore, parallelizing will put pressure on the daemon which might be even slower in answering, increasing // the risk of transient failure. @@ -222,7 +222,7 @@ func TestTailFollowRotateLogs(t *testing.T) { containerName := testutil.Identifier(t) const sampleJSONLog = `{"log":"A\n","stream":"stdout","time":"2024-04-11T12:01:09.800288974Z"}` - const linesPerFile = 5 + const linesPerFile = 2 defer base.Cmd("rm", "-f", containerName).Run() base.Cmd("run", "-d", "--log-driver", "json-file", @@ -232,7 +232,7 @@ func TestTailFollowRotateLogs(t *testing.T) { "sh", "-euc", "while true; do echo A; done").AssertOK() tailLogCmd := base.Cmd("logs", "-f", containerName) - tailLogCmd.Timeout = 2000 * time.Millisecond + tailLogCmd.Timeout = 10000 * time.Millisecond tailLogs := strings.Split(strings.TrimSpace(tailLogCmd.Run().Stdout()), "\n") for _, line := range tailLogs { if line != "" { diff --git a/pkg/testutil/testutil_linux.go b/pkg/testutil/testutil_linux.go index b6573b122a5..b3628f128e0 100644 --- a/pkg/testutil/testutil_linux.go +++ b/pkg/testutil/testutil_linux.go @@ -124,7 +124,8 @@ func NewDelayOnceReader(wrapped io.Reader) io.Reader { } func (r *delayOnceReader) Read(p []byte) (int, error) { - r.once.Do(func() { time.Sleep(time.Second) }) + // FIXME: this is obviously not exact science. At 1 second, it will fail regularly on the CI under load. + r.once.Do(func() { time.Sleep(2 * time.Second) }) n, err := r.wrapped.Read(p) if errors.Is(err, io.EOF) { time.Sleep(time.Second)