Skip to content
Open
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
2 changes: 1 addition & 1 deletion cmd/nerdctl/container/container_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bar
}

testCase.Setup = func(data test.Data, helpers test.Helpers) {
helpers.Ensure("run", "--quiet", "--name", data.Identifier(), testutil.CommonImage, "sh", "-euxc", "echo foo; echo bar;")
helpers.Ensure("run", "--quiet", "--name", data.Identifier(), testutil.CommonImage, "sh", "-euc", "echo foo; echo bar;")
data.Labels().Set("cID", data.Identifier())
}

Expand Down
19 changes: 7 additions & 12 deletions cmd/nerdctl/container/container_run_systemd_linux_test.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but still flaky
https://github.com/containerd/nerdctl/actions/runs/22777960578/job/66076770568?pr=4778

=== Failing tests ===
TestLogs
TestLogs/since_60s
TestLogs/until_60s
TestRunWithSystemdTrueEnabled

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, for logs i will have separate one.
TestRunWithSystemdTrueEnabled -> this one i will look more thoroughly. Locally its hard to reproduce.

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func TestRunWithSystemdTrueEnabled(t *testing.T) {
testCase.Require = require.All(
require.Amd64,
require.Not(nerdtest.Docker),
// // runc exec can permanently fail with "exec: already started" (https://github.com/opencontainers/runc/issues/4437)
// nerdtest.IsFlaky("https://github.com/opencontainers/runc/issues/4437"),
)

testCase.Setup = func(data test.Data, helpers test.Helpers) {
Expand All @@ -89,18 +91,11 @@ func TestRunWithSystemdTrueEnabled(t *testing.T) {
Output: expect.Contains("SIGRTMIN+3"),
})

// waits for systemd to become ready and lists systemd jobs
return helpers.Command("exec", data.Identifier(), "sh", "-c", "--", `tries=0
until systemctl is-system-running >/dev/null 2>&1; do
>&2 printf "Waiting for systemd to come up...\n"
sleep 1s
tries=$(( tries + 1))
[ $tries -lt 10 ] || {
>&2 printf "systemd failed to come up in a reasonable amount of time\n"
exit 1
}
done
systemctl list-jobs`)
helpers.Command("exec", data.Identifier(), "sh", "-c", "--", "ps").Run(&test.Expected{
ExitCode: expect.ExitCodeSuccess,
})

return helpers.Command("exec", data.Identifier(), "sh", "-c", "--", "systemctl list-jobs")
}

testCase.Expected = test.Expects(expect.ExitCodeSuccess, nil, expect.Contains("jobs"))
Expand Down
Loading