Skip to content

Commit d0d1c2d

Browse files
authored
Merge pull request containerd#4357 from apostasie/2025-06-fix-4106
[CI] Kube test: wait for image
2 parents fd4477a + 1791615 commit d0d1c2d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cmd/nerdctl/container/container_commit_linux_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package container
1919
import (
2020
"strings"
2121
"testing"
22+
"time"
2223

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

5657
testCase.Command = func(data test.Data, helpers test.Helpers) test.TestableCommand {
5758
helpers.Ensure("commit", data.Labels().Get("containerID"), data.Identifier("testcommitsave"))
59+
// Wait for the image to show up
60+
for range 5 {
61+
found := false
62+
cmd := helpers.Command("images", data.Identifier("testcommitsave"), "--format", "json")
63+
cmd.Run(&test.Expected{
64+
Output: func(stdout string, t tig.T) {
65+
found = strings.TrimSpace(stdout) != ""
66+
},
67+
})
68+
if found {
69+
break
70+
}
71+
time.Sleep(1 * time.Second)
72+
}
5873
return helpers.Command("save", data.Identifier("testcommitsave"))
5974
}
6075

0 commit comments

Comments
 (0)