Skip to content

Commit

Permalink
add more cases to cover IO errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tantalor93 committed Nov 20, 2023
1 parent dffa323 commit b83a5b1
Show file tree
Hide file tree
Showing 4 changed files with 264 additions and 115 deletions.
12 changes: 4 additions & 8 deletions cmd/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,14 +451,10 @@ func (b *Benchmark) Run(ctx context.Context) ([]*ResultStats, error) {
start := time.Now()

reqTimeoutCtx, cancel := context.WithTimeout(ctx, b.RequestTimeout)
if resp, err = query(reqTimeoutCtx, b.Server, &m); err != nil {
cancel()
st.Counters.IOError++
st.Errors = append(st.Errors, err)
} else {
cancel()
st.record(&m, resp, start, time.Since(start))
}
resp, err = query(reqTimeoutCtx, b.Server, &m)
cancel()
st.record(&m, resp, err, start, time.Since(start))

if incrementBar {
bar.Add(1)
}
Expand Down

0 comments on commit b83a5b1

Please sign in to comment.