Skip to content

Commit f4954f0

Browse files
committed
Debuggin docker failures
Signed-off-by: apostasie <[email protected]>
1 parent 7e2b221 commit f4954f0

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.github/workflows/lint.yml

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ jobs:
5555
uses: golangci/golangci-lint-action@v6
5656
with:
5757
args: --verbose
58-
5958
other:
6059
timeout-minutes: 5
6160
name: yaml | shell | imports order

.github/workflows/test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,11 @@ jobs:
281281
sudo apt-get install -y expect
282282
go install -v gotest.tools/gotestsum@v1
283283
- name: "Ensure that the integration test suite is compatible with Docker"
284-
run: ./hack/test-integration.sh -test.target=docker
284+
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker
285285
- name: "Ensure that the IPv6 integration test suite is compatible with Docker"
286-
run: ./hack/test-integration.sh -test.target=docker -test.only-ipv6
286+
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-ipv6
287287
- name: "Ensure that the integration test suite is compatible with Docker (flaky only)"
288-
run: ./hack/test-integration.sh -test.target=docker -test.only-flaky
288+
run: WITH_SUDO=true ./hack/test-integration.sh -test.target=docker -test.only-flaky
289289

290290
test-integration-windows:
291291
timeout-minutes: 30

hack/test-integration.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ readonly root
2121

2222
readonly timeout="60m"
2323
readonly retries="2"
24+
readonly needsudo="${WITH_SUDO:-}"
2425

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

41-
gotestsum "${args[@]}" -- -timeout="$timeout" -p 1 -args -test.allow-kill-daemon "$@"
42+
if [ "$needsudo" != "" ]; then
43+
gotestsum "${args[@]}" -- -timeout="$timeout" -p 1 -exec sudo -args -test.allow-kill-daemon "$@"
44+
else
45+
gotestsum "${args[@]}" -- -timeout="$timeout" -p 1 -args -test.allow-kill-daemon "$@"
46+
fi
4247

4348
echo "These are the tests that took more than 10 seconds:"
4449
gotestsum tool slowest --threshold 10s --jsonfile /tmp/test-integration.log

pkg/testutil/testutil.go

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ func (b *Base) EnsureDaemonActive() {
181181
)
182182
for i := 0; i < maxRetry; i++ {
183183
cmd := exec.Command("systemctl", append(systemctlArgs, "is-active", target)...)
184+
b.T.Log(cmd.Env)
185+
b.T.Log(cmd.Args)
186+
b.T.Log(cmd.Dir)
184187
out, err := cmd.CombinedOutput()
185188
b.T.Logf("(retry=%d) %s", i, string(out))
186189
if err == nil {

0 commit comments

Comments
 (0)