From 1d58651358e6564eabb667e68ddd5eeec11435c4 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 31 May 2025 13:31:20 +0800 Subject: [PATCH] fix flaky TestHTTPRequestAfterGracefulShutdown (#5178) --- integrationtests/self/http_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integrationtests/self/http_test.go b/integrationtests/self/http_test.go index 83535d351..6e81165b0 100644 --- a/integrationtests/self/http_test.go +++ b/integrationtests/self/http_test.go @@ -1164,7 +1164,7 @@ func testHTTPRequestAfterGracefulShutdown(t *testing.T, setGetBody bool) { cl := &http.Client{Transport: tr} // first request to establish the connection - resp, err := cl.Get(fmt.Sprintf("https://localhost:%d/", ln.Addr().(*net.UDPAddr).Port)) + resp, err := cl.Get(fmt.Sprintf("https://%s/", proxy.LocalAddr())) require.NoError(t, err) require.Equal(t, http.StatusNotFound, resp.StatusCode) @@ -1176,7 +1176,7 @@ func testHTTPRequestAfterGracefulShutdown(t *testing.T, setGetBody bool) { WroteHeaders: func() { headersCount++ }, }), http.MethodGet, - fmt.Sprintf("https://localhost:%d/echo", ln.Addr().(*net.UDPAddr).Port), + fmt.Sprintf("https://%s/echo", proxy.LocalAddr()), io.LimitReader(strings.NewReader("foobar"), 1000), ) require.NoError(t, err)