Skip to content

Commit

Permalink
Merge pull request #126 from avast/issue_99_failing_test_on_windows
Browse files Browse the repository at this point in the history
fix test for slow windows + add newer golang versions
  • Loading branch information
JaSei authored Feb 21, 2025
2 parents 01d7e00 + ac94eb5 commit 0eeb96f
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 13 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.18
- uses: actions/checkout@v3
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: latest
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go-version: ['1.18', '1.19', '1.20']
go-version: ['1.20', '1.21', '1.22', '1.23', '1.24']
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
GOVERSION: ${{ matrix.go-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
Expand All @@ -43,9 +43,9 @@ jobs:
- name: Test
run: make ci
- name: Archive code coverage results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.os }}
name: code-coverage-report-${{ matrix.os }}-${{ matrix.go-version }}
path: coverage.txt

coverage:
Expand All @@ -54,11 +54,11 @@ jobs:

steps:
- name: Download a linux coverage report
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: code-coverage-report-ubuntu-latest
name: code-coverage-report-ubuntu-latest-1.24
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
Expand Down
26 changes: 26 additions & 0 deletions current.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
goos: darwin
goarch: amd64
pkg: github.com/avast/retry-go/v4
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkDo-16 3 474128987 ns/op 2730 B/op 48 allocs/op
BenchmarkDo-16 3 441499631 ns/op 2725 B/op 47 allocs/op
BenchmarkDo-16 3 449390845 ns/op 2693 B/op 47 allocs/op
BenchmarkDo-16 3 488695333 ns/op 2725 B/op 47 allocs/op
BenchmarkDo-16 2 601685067 ns/op 2704 B/op 48 allocs/op
BenchmarkDo-16 3 336872997 ns/op 2693 B/op 47 allocs/op
BenchmarkDo-16 3 384347911 ns/op 2725 B/op 47 allocs/op
BenchmarkDo-16 3 480906307 ns/op 2693 B/op 47 allocs/op
BenchmarkDo-16 3 455362447 ns/op 2693 B/op 47 allocs/op
BenchmarkDo-16 3 443170384 ns/op 2693 B/op 47 allocs/op
BenchmarkDoNoErrors-16 6872852 159.4 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7650360 161.3 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7235683 159.3 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7465636 160.2 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7549692 160.7 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7510610 159.8 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7438124 160.3 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7416504 160.2 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7356183 160.4 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7393480 160.1 ns/op 208 B/op 4 allocs/op
PASS
ok github.com/avast/retry-go/v4 35.971s
46 changes: 46 additions & 0 deletions generic.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
goos: darwin
goarch: amd64
pkg: github.com/avast/retry-go/v4
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
BenchmarkDo-16 3 406306609 ns/op 2701 B/op 48 allocs/op
BenchmarkDo-16 3 419470846 ns/op 2693 B/op 47 allocs/op
BenchmarkDo-16 2 567716303 ns/op 2696 B/op 47 allocs/op
BenchmarkDo-16 2 562713288 ns/op 2696 B/op 47 allocs/op
BenchmarkDo-16 3 418301987 ns/op 2693 B/op 47 allocs/op
BenchmarkDo-16 2 541207332 ns/op 2696 B/op 47 allocs/op
BenchmarkDo-16 2 526211617 ns/op 2696 B/op 47 allocs/op
BenchmarkDo-16 2 517419526 ns/op 2696 B/op 47 allocs/op
BenchmarkDo-16 3 478391497 ns/op 2693 B/op 47 allocs/op
BenchmarkDo-16 3 452548175 ns/op 2725 B/op 47 allocs/op
BenchmarkDoWithData-16 3 463040866 ns/op 2693 B/op 47 allocs/op
BenchmarkDoWithData-16 3 496158943 ns/op 2693 B/op 47 allocs/op
BenchmarkDoWithData-16 3 488367012 ns/op 2725 B/op 47 allocs/op
BenchmarkDoWithData-16 3 454618897 ns/op 2693 B/op 47 allocs/op
BenchmarkDoWithData-16 3 435430056 ns/op 2693 B/op 47 allocs/op
BenchmarkDoWithData-16 2 552289967 ns/op 2744 B/op 48 allocs/op
BenchmarkDoWithData-16 3 569748815 ns/op 2693 B/op 47 allocs/op
BenchmarkDoWithData-16 3 416597207 ns/op 2725 B/op 47 allocs/op
BenchmarkDoWithData-16 3 358455415 ns/op 2725 B/op 47 allocs/op
BenchmarkDoWithData-16 3 455297803 ns/op 2725 B/op 47 allocs/op
BenchmarkDoNoErrors-16 7035135 161.9 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7389806 161.3 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7394016 161.5 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7380039 162.2 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7424865 162.2 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7111860 160.5 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7285305 162.6 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7410627 160.7 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7340961 161.6 ns/op 208 B/op 4 allocs/op
BenchmarkDoNoErrors-16 7295727 164.1 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 7357304 159.9 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 6649852 166.9 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 6938404 176.3 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 7181965 160.4 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 7311484 166.2 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 6939157 169.7 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 6648344 179.0 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 6794847 177.0 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 6782588 171.4 ns/op 208 B/op 4 allocs/op
BenchmarkDoWithDataNoErrors-16 7279119 166.9 ns/op 208 B/op 4 allocs/op
PASS
ok github.com/avast/retry-go/v4 73.128s
2 changes: 1 addition & 1 deletion retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func TestMaxDelay(t *testing.T) {
dur := time.Since(start)
assert.Error(t, err)
assert.Greater(t, dur, 120*time.Millisecond, "5 times with maximum delay retry is less than 120ms")
assert.Less(t, dur, 250*time.Millisecond, "5 times with maximum delay retry is longer than 250ms")
assert.Less(t, dur, 275*time.Millisecond, "5 times with maximum delay retry is longer than 275ms")
}

func TestBackOffDelay(t *testing.T) {
Expand Down

0 comments on commit 0eeb96f

Please sign in to comment.