Skip to content

Commit 25249e6

Browse files
committed
add 10ms delay to test proxy server startup to try to fix ubuntu tests
1 parent 102740f commit 25249e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/api/proxy_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ func startCONNECTProxy(t *testing.T, useTLS bool) (proxyURL *url.URL, obsCh <-ch
7676
cert := generateTestCert(t, "127.0.0.1")
7777
srv.TLSConfig = &tls.Config{Certificates: []tls.Certificate{cert}}
7878
go srv.ServeTLS(ln, "", "")
79+
// Give the TLS server a moment to start up to avoid race conditions
80+
time.Sleep(10 * time.Millisecond)
7981
} else {
8082
go srv.Serve(ln)
8183
}
@@ -144,6 +146,8 @@ func startCONNECTProxyWithAuth(t *testing.T, useTLS bool, wantUser, wantPass str
144146
cert := generateTestCert(t, "127.0.0.1")
145147
srv.TLSConfig = &tls.Config{Certificates: []tls.Certificate{cert}}
146148
go srv.ServeTLS(ln, "", "")
149+
// Give the TLS server a moment to start up to avoid race conditions
150+
time.Sleep(10 * time.Millisecond)
147151
} else {
148152
go srv.Serve(ln)
149153
}

0 commit comments

Comments
 (0)