Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/proxy/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func Test_healthHandlerDeadlock(t *testing.T) {
func TestHttp_healthHandler(t *testing.T) {
port, releasePort := getFreePort(t)
h := Http{Timeouts: Timeouts{ResponseHeader: 200 * time.Millisecond}, Address: fmt.Sprintf("127.0.0.1:%d", port)}
ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

ds := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -107,8 +107,7 @@ func TestHttp_healthHandler(t *testing.T) {
_ = h.Run(ctx)
}()

// wait for discovery service to load mappers
time.Sleep(50 * time.Millisecond)
require.Eventually(t, func() bool { return len(svc.Mappers()) == 5 }, time.Second, 10*time.Millisecond)

client := http.Client{}
var resp *http.Response
Expand Down