Skip to content

Commit

Permalink
Fix flaky TestHedgedResponseWins (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Aug 19, 2023
1 parent 6504b04 commit b75354a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hedged_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func TestHedgedResponseWins(t *testing.T) {
if err != nil {
t.Fatal(err)
}
client, metrics, err := hedgedhttp.NewClientAndStats(10*time.Millisecond, 5, nil)
client, metrics, err := hedgedhttp.NewClientAndStats(5*time.Millisecond, 5, nil)
if err != nil {
t.Fatalf("want nil, got %s", err)
}
Expand All @@ -363,10 +363,10 @@ func TestHedgedResponseWins(t *testing.T) {
t.Fatalf("Unnexpected actualRoundTrips: %v", actualRoundTrips)
}
if originalRequestWins := metrics.OriginalRequestWins(); originalRequestWins != 0 {
t.Fatalf("Unnexpected actualRoundTrips: %v", originalRequestWins)
t.Fatalf("Unnexpected originalRequestWins: %v", originalRequestWins)
}
if hedgedRequestWins := metrics.HedgedRequestWins(); hedgedRequestWins != 1 {
t.Fatalf("Unnexpected actualRoundTrips: %v", hedgedRequestWins)
t.Fatalf("Unnexpected hedgedRequestWins: %v", hedgedRequestWins)
}
if failedRoundTrips := metrics.FailedRoundTrips(); failedRoundTrips != 0 {
t.Fatalf("Unnexpected failedRoundTrips: %v", failedRoundTrips)
Expand Down

0 comments on commit b75354a

Please sign in to comment.