Skip to content

Commit

Permalink
Simplify tests (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Sep 13, 2023
1 parent b75354a commit 32ed3a6
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 414 deletions.
11 changes: 4 additions & 7 deletions hedged_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ func BenchmarkHedgedRequest(b *testing.B) {
var snapshot atomic.Value

hedgedTarget, metrics, err := hedgedhttp.NewRoundTripperAndStats(10*time.Nanosecond, 10, target)
if err != nil {
b.Fatalf("want nil, got %s", err)
}
mustOk(b, err)

initialSnapshot := metrics.Snapshot()
snapshot.Store(&initialSnapshot)
Expand All @@ -83,10 +81,9 @@ func BenchmarkHedgedRequest(b *testing.B) {
snapshot.Store(&currentSnapshot)
}
}()
req, err := http.NewRequest(http.MethodGet, "", http.NoBody)
if err != nil {
b.Fatal(err)
}

req := newGetReq("whatever")
mustOk(b, err)

var wg sync.WaitGroup
wg.Add(bm.concurrency)
Expand Down
Loading

0 comments on commit 32ed3a6

Please sign in to comment.