diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa8b68ca2be..0fe4122979f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,12 +86,7 @@ jobs: - name: "Register QEMU (tonistiigi/binfmt)" run: docker run --privileged --rm tonistiigi/binfmt --install all - name: "Run integration tests" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 30 - max_attempts: 2 - retry_on: error - command: docker run -t --rm --privileged test-integration + run: docker run -t --rm --privileged test-integration test-integration-ipv6: runs-on: "ubuntu-${{ matrix.ubuntu }}" @@ -135,12 +130,7 @@ jobs: # On the other side, using the host network is easier at configuration. # Besides, each job is running on a different instance, which means using host network here # is safe and has no side effects on others. - uses: nick-fields/retry@v3 - with: - timeout_minutes: 30 - max_attempts: 2 - retry_on: error - command: docker run --network host -t --rm --privileged test-integration-ipv6 + run: docker run --network host -t --rm --privileged test-integration-ipv6 test-integration-rootless: runs-on: "ubuntu-${{ matrix.ubuntu }}" @@ -219,12 +209,7 @@ jobs: - name: "Prepare (network driver=slirp4netns, port driver=builtin)" 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} . - name: "Test (network driver=slirp4netns, port driver=builtin)" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 30 - max_attempts: 2 - retry_on: error - command: docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=1 ${TEST_TARGET} + run: docker run -t --rm --privileged -e WORKAROUND_ISSUE_622=1 ${TEST_TARGET} cross: runs-on: ubuntu-24.04 @@ -267,19 +252,9 @@ jobs: run: | sudo apt-get install -y expect - name: "Ensure that the integration test suite is compatible with Docker" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 30 - max_attempts: 2 - retry_on: error - command: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon + run: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon - name: "Ensure that the IPv6 integration test suite is compatible with Docker" - uses: nick-fields/retry@v3 - with: - timeout_minutes: 30 - max_attempts: 2 - retry_on: error - command: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon -test.ipv6 + run: go test -timeout 20m -v -exec sudo ./cmd/nerdctl/... -args -test.target=docker -test.kill-daemon -test.ipv6 test-integration-windows: runs-on: windows-2022 diff --git a/Dockerfile b/Dockerfile index fa41e63de70..a3c6843fc65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -313,7 +313,7 @@ RUN curl -L -o nydus-static.tgz "https://github.com/dragonflyoss/image-service/r tar xzf nydus-static.tgz && \ mv nydus-static/nydus-image nydus-static/nydusd nydus-static/nydusify /usr/bin/ && \ rm nydus-static.tgz -CMD ["gotestsum", "--format=testname", "--rerun-fails=2", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \ +CMD ["gotestsum", "--format=testname", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \ "--", "-timeout=30m", "-args", "-test.kill-daemon"] FROM test-integration AS test-integration-rootless @@ -338,7 +338,7 @@ VOLUME /home/rootless/.local/share RUN go test -o /usr/local/bin/nerdctl.test -c ./cmd/nerdctl COPY ./Dockerfile.d/test-integration-rootless.sh / CMD ["/test-integration-rootless.sh", \ - "gotestsum", "--format=testname", "--rerun-fails=2", "--raw-command", \ + "gotestsum", "--format=testname", "--raw-command", \ "--", "/usr/local/go/bin/go", "tool", "test2json", "-t", "-p", "github.com/containerd/nerdctl/v2/cmd/nerdctl", \ "/usr/local/bin/nerdctl.test", "-test.v", "-test.timeout=30m", "-test.kill-daemon"] @@ -348,7 +348,7 @@ COPY ./Dockerfile.d/home_rootless_.config_systemd_user_containerd.service.d_port RUN chown -R rootless:rootless /home/rootless/.config FROM test-integration AS test-integration-ipv6 -CMD ["gotestsum", "--format=testname", "--rerun-fails=2", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \ +CMD ["gotestsum", "--format=testname", "--packages=github.com/containerd/nerdctl/v2/cmd/nerdctl/...", \ "--", "-timeout=30m", "-args", "-test.kill-daemon", "-test.ipv6"] FROM base AS demo diff --git a/cmd/nerdctl/container_prune_linux_test.go b/cmd/nerdctl/container_prune_linux_test.go index 47560af3acb..674f5dd4f96 100644 --- a/cmd/nerdctl/container_prune_linux_test.go +++ b/cmd/nerdctl/container_prune_linux_test.go @@ -27,8 +27,8 @@ func TestPruneContainer(t *testing.T) { tID := testutil.Identifier(t) tearDown := func() { - defer base.Cmd("rm", "-f", tID+"-1").Run() - defer base.Cmd("rm", "-f", tID+"-2").Run() + base.Cmd("rm", "-f", tID+"-1").Run() + base.Cmd("rm", "-f", tID+"-2").Run() } tearUp := func() {