Skip to content

Commit

Permalink
Check both IPv4 and IPv6 ports explicitly
Browse files Browse the repository at this point in the history
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 GitoxideLabs#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.
  • Loading branch information
EliahKagan committed Dec 18, 2024
1 parent b6cf3b4 commit 06b466b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ function small-repo-in-sandbox() {

function launch-git-daemon() {
local port=9418
if nc -z localhost "$port"; then
echo "Port $port should not have been open before this test's run of the git daemon!" >&2
if nc -4z localhost "$port"; then
echo "Port $port (IPv4) should not have been open before this test's run of the git daemon!" >&2
return 1
fi
if nc -6z localhost "$port"; then
echo "Port $port (IPv6) should not have been open before this test's run of the git daemon!" >&2
return 1
fi
if pgrep git-daemon; then
Expand Down

0 comments on commit 06b466b

Please sign in to comment.