From 7db686eeb03840a9d8612981574ffee95e790600 Mon Sep 17 00:00:00 2001 From: Veillax <126523099+Veillax@users.noreply.github.com> Date: Mon, 26 Oct 2026 12:22:12 -0600 Subject: [PATCH] Retry PROXY e2e reads while the tunnel handshake completes The first connection through the tunnel can exceed the read deadline on a slow CI runner. Co-Authored-By: Claude Sonnet 5.5 --- e2e/proxyproto_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/proxyproto_test.go b/e2e/proxyproto_test.go index c493911..a478408 100644 --- a/e2e/proxyproto_test.go +++ b/e2e/proxyproto_test.go @@ -91,7 +91,10 @@ func proxyBackend(t *testing.T, seen chan<- string) int { func askFrom(t *testing.T, from, addr, send string) string { t.Helper() var last error - for i := 0; i < 50; i++ { + // The first connection through the tunnel can wait for the WireGuard handshake, which is + // slow on a busy CI runner, so a read timeout is retried until the overall deadline. + deadline := time.Now().Add(30 * time.Second) + for time.Now().Before(deadline) { d := net.Dialer{LocalAddr: &net.TCPAddr{IP: net.ParseIP(from)}, Timeout: time.Second} c, err := d.Dial("tcp", addr) if err == nil { @@ -102,9 +105,6 @@ func askFrom(t *testing.T, from, addr, send string) string { if rerr == nil { return strings.TrimSpace(line) } - if ne, ok := rerr.(net.Error); ok && ne.Timeout() { - t.Fatalf("%s accepted the connection but never answered: %v", addr, rerr) // a real hang, not a startup race - } last = rerr } else { last = err