Skip to content

Commit 388fe79

Browse files
authored
Merge pull request containerd#3564 from apostasie/chores
Chores
2 parents 44bd960 + ce8e077 commit 388fe79

12 files changed

+29
-39
lines changed

cmd/nerdctl/container/container_create_linux_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ func TestCreateWithMACAddress(t *testing.T) {
131131
// res = base.Cmd("start", "-i", containerName).
132132
// CmdOption(testutil.WithStdin(strings.NewReader("ip addr show eth0 | grep ether | awk '{printf $2}'"))).Run()
133133
res = base.Cmd("start", "-a", containerName).Run()
134+
// FIXME: flaky - this has failed on the CI once, with the output NOT containing anything
135+
// https://github.com/containerd/nerdctl/actions/runs/11392051487/job/31697214002?pr=3535#step:7:271
134136
assert.Assert(t, strings.Contains(res.Stdout(), expect), fmt.Sprintf("expected output to contain %q: %q", expect, res.Stdout()))
135137
assert.Assert(t, res.ExitCode == 0, "Command should have succeeded")
136138
} else {

cmd/nerdctl/container/container_logs_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func TestLogsOutStreamsSeparated(t *testing.T) {
8282
}
8383

8484
func TestLogsWithInheritedFlags(t *testing.T) {
85+
// Seen flaky with Docker
8586
t.Parallel()
8687
base := testutil.NewBase(t)
8788
for k, v := range base.Args {

cmd/nerdctl/container/container_stop_linux_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ func TestStopStart(t *testing.T) {
7373

7474
func TestStopWithStopSignal(t *testing.T) {
7575
t.Parallel()
76+
// There may be issues with logs in Docker.
77+
// This test is flaky with Docker. Might be related to https://github.com/containerd/nerdctl/pull/3557
7678
base := testutil.NewBase(t)
7779
testContainerName := testutil.Identifier(t)
7880
defer base.Cmd("rm", "-f", testContainerName).Run()

cmd/nerdctl/image/image_inspect_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package image
1818

1919
import (
2020
"encoding/json"
21+
"runtime"
2122
"strings"
2223
"testing"
2324

@@ -63,6 +64,10 @@ func TestImageInspectSimpleCases(t *testing.T) {
6364
},
6465
}
6566

67+
if runtime.GOOS == "windows" {
68+
testCase.Require = nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3524")
69+
}
70+
6671
testCase.Run(t)
6772
}
6873

cmd/nerdctl/image/image_list_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package image
1919
import (
2020
"errors"
2121
"fmt"
22+
"runtime"
2223
"slices"
2324
"strings"
2425
"testing"
@@ -118,6 +119,13 @@ func TestImages(t *testing.T) {
118119
},
119120
}
120121

122+
if runtime.GOOS == "windows" {
123+
testCase.Require = test.Require(
124+
testCase.Require,
125+
nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3524"),
126+
)
127+
}
128+
121129
testCase.Run(t)
122130
}
123131

@@ -180,7 +188,7 @@ RUN echo "actually creating a layer so that docker sets the createdAt time"
180188
},
181189
},
182190
{
183-
Description: "label=foo=bar label=version=0.1",
191+
Description: "label=foo=bar label=version=0.2",
184192
Command: test.Command("images", "--filter", "label=foo=bar", "--filter", "label=version=0.2"),
185193
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
186194
return &test.Expected{
@@ -190,7 +198,6 @@ RUN echo "actually creating a layer so that docker sets the createdAt time"
190198
},
191199
{
192200
Description: "label=version",
193-
Require: nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3512"),
194201
Command: test.Command("images", "--filter", "label=version"),
195202
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
196203
return &test.Expected{

cmd/nerdctl/image/image_save_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package image
1919
import (
2020
"os"
2121
"path/filepath"
22+
"runtime"
2223
"strings"
2324
"testing"
2425

@@ -70,6 +71,10 @@ func TestSave(t *testing.T) {
7071
// See https://github.com/containerd/nerdctl/issues/3425 and others for details.
7172
testCase.Require = nerdtest.Private
7273

74+
if runtime.GOOS == "windows" {
75+
testCase.Require = nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3524")
76+
}
77+
7378
testCase.SubTests = []*test.Case{
7479
{
7580
Description: "Single image, by id",

cmd/nerdctl/ipfs/ipfs_compose_linux_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func TestIPFSCompNoBuild(t *testing.T) {
4646
test.Not(nerdtest.Docker),
4747
nerdtest.Registry,
4848
nerdtest.IPFS,
49+
nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3510"),
4950
// See note below
5051
// nerdtest.Private,
5152
)
@@ -153,6 +154,7 @@ services:
153154
WORDPRESS_DB_USER: exampleuser
154155
WORDPRESS_DB_PASSWORD: examplepass
155156
WORDPRESS_DB_NAME: exampledb
157+
# FIXME: this is flaky and will make the container fail on occasions
156158
volumes:
157159
- wordpress:/var/www/html
158160

cmd/nerdctl/network/network_create_linux_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ func TestNetworkCreate(t *testing.T) {
3535
testCase.SubTests = []*test.Case{
3636
{
3737
Description: "vanilla",
38-
// #3491 and #3508 may have helped - commenting this out for now
39-
// Require: nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3086"),
4038
Setup: func(data test.Data, helpers test.Helpers) {
4139
helpers.Ensure("network", "create", data.Identifier())
4240
netw := nerdtest.InspectNetwork(helpers, data.Identifier())
@@ -66,8 +64,6 @@ func TestNetworkCreate(t *testing.T) {
6664
},
6765
{
6866
Description: "with MTU",
69-
// #3491 and #3508 may have helped - commenting this out for now
70-
// Require: nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3086"),
7167
Setup: func(data test.Data, helpers test.Helpers) {
7268
helpers.Ensure("network", "create", data.Identifier(), "--driver", "bridge", "--opt", "com.docker.network.driver.mtu=9216")
7369
},
@@ -81,9 +77,7 @@ func TestNetworkCreate(t *testing.T) {
8177
},
8278
{
8379
Description: "with ipv6",
84-
// #3491 and #3508 may have helped - commenting this out for now
85-
// Require: nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3086"),
86-
Require: nerdtest.OnlyIPv6,
80+
Require: nerdtest.OnlyIPv6,
8781
Setup: func(data test.Data, helpers test.Helpers) {
8882
subnetStr := "2001:db8:8::/64"
8983
data.Set("subnetStr", subnetStr)

cmd/nerdctl/network/network_list_linux_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ import (
2929
func TestNetworkLsFilter(t *testing.T) {
3030
testCase := nerdtest.Setup()
3131

32-
// #3491 and #3508 may have helped - commenting this out for now
33-
// testCase.Require = nerdtest.IsFlaky("https://github.com/containerd/nerdctl/issues/3086"),
34-
3532
testCase.Setup = func(data test.Data, helpers test.Helpers) {
3633
data.Set("identifier", data.Identifier())
3734
data.Set("label", "mylabel=label-1")

pkg/cmd/image/ensure.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ func ensureOne(ctx context.Context, client *containerd.Client, rawRef string, ta
6565
if err != nil {
6666
return err
6767
}
68-
// if platform == nil {
69-
// platform = platforms.DefaultSpec()
70-
//}
7168
pltf := []ocispec.Platform{platform}
7269
platformComparer := platformutil.NewMatchComparerFromOCISpecPlatformSlice(pltf)
7370

0 commit comments

Comments
 (0)