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
15 changes: 15 additions & 0 deletions cmd/nerdctl/container/container_commit_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package container
import (
"strings"
"testing"
"time"

"github.com/containerd/nerdctl/mod/tigron/test"
"github.com/containerd/nerdctl/mod/tigron/tig"
Expand Down Expand Up @@ -55,6 +56,20 @@ func TestKubeCommitSave(t *testing.T) {

testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {
helpers.Ensure("commit", data.Labels().Get("containerID"), data.Identifier("testcommitsave"))
// Wait for the image to show up
for range 5 {
found := false
cmd := helpers.Command("images", data.Identifier("testcommitsave"), "--format", "json")
cmd.Run(&test.Expected{
Output: func(stdout string, t tig.T) {
found = strings.TrimSpace(stdout) != ""
},
})
if found {
break
}
time.Sleep(1 * time.Second)
}
return helpers.Command("save", data.Identifier("testcommitsave"))
}

Expand Down