Point the unreachable-app test at port 1 #52

Merged
clawbot merged 1 commits from issue-51-unreachable-app-test into next 2026-10-04 06:39:09 +02:00
Showing only changes of commit d8b8936f46 - Show all commits
+2 -10
View File
@@ -5,7 +5,6 @@ import (
"bytes"
"errors"
"io"
"net"
"net/http"
"slices"
"strings"
@@ -354,15 +353,8 @@ func TestRefusesHeadersOver32KiB(t *testing.T) {
func TestAnswers502WhenTheAppCannotBeReached(t *testing.T) {
t.Parallel()
listener, err := (&net.ListenConfig{}).Listen(t.Context(), "tcp", localhost+":0")
if err != nil {
t.Fatalf("listen: %v", err)
}
closedAddr := listener.Addr().String()
_ = listener.Close()
addr, out := startProxy(t, "http://"+closedAddr, nil)
// No test can listen on port 1: listening on port 0 gets one from 32768 up.
addr, out := startProxy(t, "http://"+localhost+":1", nil)
wantStatus(t, get(t, addr, "/"), http.StatusBadGateway)
wantLine(t, out.requestLine(t), http.StatusBadGateway,