Skip to content

Commit

Permalink
test: Don't start server until all configured (#12226)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul1r authored Mar 15, 2024
1 parent 3dd5b70 commit 0d1a369
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/chunk/client/gcp/gcs_object_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func fakeHTTPRespondingServer(t *testing.T, code int) *httptest.Server {
}

func fakeSleepingServer(t *testing.T, responseSleep, connectSleep time.Duration, closeOnNew, closeOnActive bool) *httptest.Server {
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// sleep on response to mimic server overload
time.Sleep(responseSleep)
}))
Expand All @@ -264,6 +264,6 @@ func fakeSleepingServer(t *testing.T, responseSleep, connectSleep time.Duration,
}
}
t.Cleanup(server.Close)

server.Start()
return server
}

0 comments on commit 0d1a369

Please sign in to comment.