Skip to content
Merged
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
10 changes: 10 additions & 0 deletions cmd/nerdctl/container/container_commit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ func TestCommit(t *testing.T) {
helpers.Anyhow("rmi", "-f", data.Identifier())
},
Setup: func(data test.Data, helpers test.Helpers) {
// FIXME: short of pulling first, docker will fail to start the container.
// Debugging shows container exited immediately. Nothing in the container logs. Not much in journalctl.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you repro the issue without using the nerdctl test suite?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It does happen on #3535, but I cannot repro locally for now.

I believe it was previously hidden with retries.

I will report on moby if I manage to get a reproducer outside of the CI context.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No idea; haven't seen that issue. With the default pull policy ("missing"), the CLI should trigger a pull when the API endpoint returns a 404; https://github.com/docker/cli/blob/8a7c5ae68f42061fa3085736b91a9e831e0eab07/cli/command/container/create.go#L272-L289

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe the pull was successful on run.
Totally spitballing: this might be a race issue with docker starting and starting a container?

// It is not clear what is happening.
if nerdtest.IsDocker() {
helpers.Ensure("pull", testutil.CommonImage)
}
helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage, "sleep", "infinity")
nerdtest.EnsureContainerStarted(helpers, data.Identifier())
helpers.Ensure("exec", data.Identifier(), "sh", "-euxc", `echo hello-test-commit > /foo`)
Expand All @@ -59,6 +65,10 @@ func TestCommit(t *testing.T) {
helpers.Anyhow("rmi", "-f", data.Identifier())
},
Setup: func(data test.Data, helpers test.Helpers) {
// See note above about docker failing.
if nerdtest.IsDocker() {
helpers.Ensure("pull", testutil.CommonImage)
}
helpers.Ensure("run", "-d", "--name", data.Identifier(), testutil.CommonImage, "sleep", "infinity")
nerdtest.EnsureContainerStarted(helpers, data.Identifier())
helpers.Ensure("exec", data.Identifier(), "sh", "-euxc", `echo hello-test-commit > /foo`)
Expand Down