Skip to content

Commit 3eae9de

Browse files
committed
Fix IPFS test flakyness
Signed-off-by: apostasie <[email protected]>
1 parent 3be680c commit 3eae9de

File tree

3 files changed

+10
-35
lines changed

3 files changed

+10
-35
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,7 @@ jobs:
8686
- name: "Register QEMU (tonistiigi/binfmt)"
8787
run: docker run --privileged --rm tonistiigi/binfmt --install all
8888
- name: "Run integration tests"
89-
uses: nick-fields/retry@v3
90-
with:
91-
timeout_minutes: 30
92-
max_attempts: 2
93-
retry_on: error
94-
command: docker run -t --rm --privileged test-integration
89+
run: docker run -t --rm --privileged test-integration
9590

9691
test-integration-ipv6:
9792
runs-on: "ubuntu-${{ matrix.ubuntu }}"
@@ -135,12 +130,7 @@ jobs:
135130
# On the other side, using the host network is easier at configuration.
136131
# Besides, each job is running on a different instance, which means using host network here
137132
# is safe and has no side effects on others.
138-
uses: nick-fields/retry@v3
139-
with:
140-
timeout_minutes: 30
141-
max_attempts: 2
142-
retry_on: error
143-
command: docker run --network host -t --rm --privileged test-integration-ipv6
133+
run: docker run --network host -t --rm --privileged test-integration-ipv6
144134

145135
test-integration-rootless:
146136
runs-on: "ubuntu-${{ matrix.ubuntu }}"
@@ -219,12 +209,7 @@ jobs:
219209
- name: "Prepare (network driver=slirp4netns, port driver=builtin)"
220210
run: DOCKER_BUILDKIT=1 docker build -t ${TEST_TARGET} --target ${TEST_TARGET} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} --build-arg ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION} .
221211
- name: "Test (network driver=slirp4netns, port driver=builtin)"
222-
uses: nick-fields/retry@v3
223-
with:
224-
timeout_minutes: 30
225-
max_attempts: 2
226-
retry_on: error
227-
command: docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=1 ${TEST_TARGET}
212+
run: docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=1 ${TEST_TARGET}
228213

229214
cross:
230215
runs-on: ubuntu-24.04
@@ -267,19 +252,9 @@ jobs:
267252
run: |
268253
sudo apt-get install -y expect
269254
- name: "Ensure that the integration test suite is compatible with Docker"
270-
uses: nick-fields/retry@v3
271-
with:
272-
timeout_minutes: 30
273-
max_attempts: 2
274-
retry_on: error
275-
command: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon
255+
run: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon
276256
- name: "Ensure that the IPv6 integration test suite is compatible with Docker"
277-
uses: nick-fields/retry@v3
278-
with:
279-
timeout_minutes: 30
280-
max_attempts: 2
281-
retry_on: error
282-
command: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon -test.ipv6
257+
run: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon -test.ipv6
283258

284259
test-integration-windows:
285260
runs-on: windows-2022

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ RUN curl -L -o nydus-static.tgz "https://github.com/dragonflyoss/image-service/r
313313
tar xzf nydus-static.tgz && \
314314
mv nydus-static/nydus-image nydus-static/nydusd nydus-static/nydusify /usr/bin/ && \
315315
rm nydus-static.tgz
316-
CMD ["gotestsum", "--format=testname", "--rerun-fails=2", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \
316+
CMD ["gotestsum", "--format=testname", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \
317317
"--", "-timeout=30m", "-args", "-test.kill-daemon"]
318318

319319
FROM test-integration AS test-integration-rootless
@@ -338,7 +338,7 @@ VOLUME /home/rootless/.local/share
338338
RUN go test -o /usr/local/bin/nerdctl.test -c ./cmd/nerdctl
339339
COPY ./Dockerfile.d/test-integration-rootless.sh /
340340
CMD ["/test-integration-rootless.sh", \
341-
"gotestsum", "--format=testname", "--rerun-fails=2", "--raw-command", \
341+
"gotestsum", "--format=testname", "--raw-command", \
342342
"--", "/usr/local/go/bin/go", "tool", "test2json", "-t", "-p", "github.com/containerd/nerdctl/v2/cmd/nerdctl", \
343343
"/usr/local/bin/nerdctl.test", "-test.v", "-test.timeout=30m", "-test.kill-daemon"]
344344

@@ -348,7 +348,7 @@ COPY ./Dockerfile.d/home_rootless_.config_systemd_user_containerd.service.d_port
348348
RUN chown -R rootless:rootless /home/rootless/.config
349349

350350
FROM test-integration AS test-integration-ipv6
351-
CMD ["gotestsum", "--format=testname", "--rerun-fails=2", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \
351+
CMD ["gotestsum", "--format=testname", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \
352352
"--", "-timeout=30m", "-args", "-test.kill-daemon", "-test.ipv6"]
353353

354354
FROM base AS demo

cmd/nerdctl/container_prune_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ func TestPruneContainer(t *testing.T) {
2727
tID := testutil.Identifier(t)
2828

2929
tearDown := func() {
30-
defer base.Cmd("rm", "-f", tID+"-1").Run()
31-
defer base.Cmd("rm", "-f", tID+"-2").Run()
30+
base.Cmd("rm", "-f", tID+"-1").Run()
31+
base.Cmd("rm", "-f", tID+"-2").Run()
3232
}
3333

3434
tearUp := func() {

0 commit comments

Comments
 (0)