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