Skip to content

Commit 6f45408

Browse files
authored
[chore] remove TODO from confighttp tests (#9121)
Since the listener is already listening, the Serve call will not introduce a delay in processing requests. It is then fair to block the main thread on waiting the goroutine to be started, and unblock before Serve is called.
1 parent 70f8124 commit 6f45408

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

config/confighttp/confighttp_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,6 @@ func TestHttpReception(t *testing.T) {
706706
_ = s.Serve(ln)
707707
}()
708708

709-
// Wait for the servers to start
710-
<-time.After(10 * time.Millisecond)
711-
712709
prefix := "https://"
713710
expectedProto := "HTTP/2.0"
714711
if tt.tlsClientCreds.Insecure {
@@ -821,10 +818,6 @@ func TestHttpCors(t *testing.T) {
821818
_ = s.Serve(ln)
822819
}()
823820

824-
// TODO: make starting server deterministic
825-
// Wait for the servers to start
826-
<-time.After(10 * time.Millisecond)
827-
828821
url := fmt.Sprintf("http://%s", ln.Addr().String())
829822

830823
expectedStatus := http.StatusNoContent
@@ -941,10 +934,6 @@ func TestHttpServerHeaders(t *testing.T) {
941934
_ = s.Serve(ln)
942935
}()
943936

944-
// TODO: make starting server deterministic
945-
// Wait for the servers to start
946-
<-time.After(10 * time.Millisecond)
947-
948937
url := fmt.Sprintf("http://%s", ln.Addr().String())
949938

950939
// Verify allowed domain gets responses that allow CORS.
@@ -1346,9 +1335,6 @@ func BenchmarkHttpRequest(b *testing.B) {
13461335
_ = s.Close()
13471336
}()
13481337

1349-
// Wait for the servers to start
1350-
<-time.After(10 * time.Millisecond)
1351-
13521338
for _, bb := range tests {
13531339
hcs := &HTTPClientSettings{
13541340
Endpoint: "https://" + ln.Addr().String(),

0 commit comments

Comments
 (0)