Skip to content

Commit

Permalink
Merge pull request #3574 from apostasie/test-docker-workaround
Browse files Browse the repository at this point in the history
Workaround and document weird docker issue
  • Loading branch information
AkihiroSuda authored Oct 18, 2024
2 parents dbcc3bc + 5609de3 commit 7ab9155
Showing 1 changed file with 10 additions and 0 deletions.
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.
// 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

0 comments on commit 7ab9155

Please sign in to comment.