Skip to content

Commit

Permalink
[chore] remove TODO from confighttp tests (#9121)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
atoulme authored Dec 18, 2023
1 parent 70f8124 commit 6f45408
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions config/confighttp/confighttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,6 @@ func TestHttpReception(t *testing.T) {
_ = s.Serve(ln)
}()

// Wait for the servers to start
<-time.After(10 * time.Millisecond)

prefix := "https://"
expectedProto := "HTTP/2.0"
if tt.tlsClientCreds.Insecure {
Expand Down Expand Up @@ -821,10 +818,6 @@ func TestHttpCors(t *testing.T) {
_ = s.Serve(ln)
}()

// TODO: make starting server deterministic
// Wait for the servers to start
<-time.After(10 * time.Millisecond)

url := fmt.Sprintf("http://%s", ln.Addr().String())

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

// TODO: make starting server deterministic
// Wait for the servers to start
<-time.After(10 * time.Millisecond)

url := fmt.Sprintf("http://%s", ln.Addr().String())

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

// Wait for the servers to start
<-time.After(10 * time.Millisecond)

for _, bb := range tests {
hcs := &HTTPClientSettings{
Endpoint: "https://" + ln.Addr().String(),
Expand Down

0 comments on commit 6f45408

Please sign in to comment.