Skip to content

Commit

Permalink
Debuggin docker failures
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Oct 19, 2024
1 parent 7e2b221 commit d64e9f7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
args: --verbose

group: 'lint'
other:
timeout-minutes: 5
name: yaml | shell | imports order
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ jobs:
sudo apt-get install -y expect
go install -v gotest.tools/gotestsum@v1
- name: "Ensure that the integration test suite is compatible with Docker"
run: ./hack/test-integration.sh -test.target=docker
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker
- name: "Ensure that the IPv6 integration test suite is compatible with Docker"
run: ./hack/test-integration.sh -test.target=docker -test.only-ipv6
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-ipv6
- name: "Ensure that the integration test suite is compatible with Docker (flaky only)"
run: ./hack/test-integration.sh -test.target=docker -test.only-flaky
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-flaky

test-integration-windows:
timeout-minutes: 30
Expand Down
7 changes: 6 additions & 1 deletion hack/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ readonly root

readonly timeout="60m"
readonly retries="2"
readonly needsudo="${WITH_SUDO:-}"

# See https://github.com/containerd/nerdctl/blob/main/docs/testing/README.md#about-parallelization
args=(--format=testname --jsonfile /tmp/test-integration.log --packages="$root"/../cmd/nerdctl/...)
Expand All @@ -38,7 +39,11 @@ for arg in "$@"; do
fi
done

gotestsum "${args[@]}" -- -timeout="$timeout" -p 1 -args -test.allow-kill-daemon "$@"
if [ "$needsudo" != "" ]; then
gotestsum "${args[@]}" -- -timeout="$timeout" -p 1 -exec sudo -args -test.allow-kill-daemon "$@"
else
gotestsum "${args[@]}" -- -timeout="$timeout" -p 1 -args -test.allow-kill-daemon "$@"
fi

echo "These are the tests that took more than 10 seconds:"
gotestsum tool slowest --threshold 10s --jsonfile /tmp/test-integration.log
3 changes: 3 additions & 0 deletions pkg/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ func (b *Base) EnsureDaemonActive() {
)
for i := 0; i < maxRetry; i++ {
cmd := exec.Command("systemctl", append(systemctlArgs, "is-active", target)...)
b.T.Log(cmd.Env)
b.T.Log(cmd.Args)
b.T.Log(cmd.Dir)
out, err := cmd.CombinedOutput()
b.T.Logf("(retry=%d) %s", i, string(out))
if err == nil {
Expand Down

0 comments on commit d64e9f7

Please sign in to comment.