Skip to content

Commit 4d2e25c

Browse files
committed
Check both IPv4 and IPv6 ports explicitly
In each CI run with failing journey tests due to not being able to connect to `git daemon`, there are also passing tests, and in each run that I have observed, including an early run presented in #1634 (https://github.com/GitoxideLabs/gitoxide/actions/runs/12359365805/job/34491924319?pr=1634#step:6:1049), all passing journey tests (of those with non-skipped contents) that connect to the git daemon do so after `nc` has reported success connecting to `::1` (IPv6 loclahost), and the failing journey test that attempts to connect to the git daemon does so after `nc` has reported success connecting to `127.0.0.1` (IPv4 localhost). That doesn't clearly elucidate what would be going wrong, and it is possible that the problem is unrelaced, but it looks worthwhile to check into it. At this point, the git daemon is still not told what to listen on. First I just want to see what `nc` reports when checking for both to ensure that nothing is listening on either of them each time `git-daemon` is about to be run.
1 parent 4dd0942 commit 4d2e25c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/helpers.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ function small-repo-in-sandbox() {
6161

6262
function launch-git-daemon() {
6363
local port=9418
64-
if nc -z localhost "$port"; then
65-
echo "Port $port should not have been open before this test's run of the git daemon!" >&2
64+
if nc -4z localhost "$port"; then
65+
echo "Port $port (IPv4) should not have been open before this test's run of the git daemon!" >&2
66+
return 1
67+
fi
68+
if nc -6z localhost "$port"; then
69+
echo "Port $port (IPv6) should not have been open before this test's run of the git daemon!" >&2
6670
return 1
6771
fi
6872
if pgrep git-daemon; then

0 commit comments

Comments
 (0)