Skip to content

Commit

Permalink
Merge pull request #194 from Tantalor93/errortests
Browse files Browse the repository at this point in the history
add more cases to cover IO errors
  • Loading branch information
Tantalor93 committed Nov 21, 2023
2 parents dffa323 + 64df9a9 commit e6ec30d
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 116 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
cache: false
go-version-file: go.mod
- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.55.2
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
Loading

0 comments on commit e6ec30d

Please sign in to comment.