From 74ef79ea236884167adeaa06515f595a0b610327 Mon Sep 17 00:00:00 2001 From: mpl Date: Thu, 15 Dec 2022 11:18:05 +0100 Subject: [PATCH] mitigate race against server readiness in test Co-authored-by: Romain --- pkg/server/server_entrypoint_tcp_http3_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/server/server_entrypoint_tcp_http3_test.go b/pkg/server/server_entrypoint_tcp_http3_test.go index 6544dd2e0..257ac3d72 100644 --- a/pkg/server/server_entrypoint_tcp_http3_test.go +++ b/pkg/server/server_entrypoint_tcp_http3_test.go @@ -6,6 +6,7 @@ import ( "crypto/tls" "net/http" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -113,6 +114,9 @@ func TestHTTP3AdvertisedPort(t *testing.T) { }) require.NoError(t, err) + // We are racing with the http3Server readiness happening in the goroutine starting the entrypoint + time.Sleep(time.Second) + request, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:8090", nil) require.NoError(t, err)