Skip to content

Commit 0eeb96f

Browse files
authored
Merge pull request #126 from avast/issue_99_failing_test_on_windows
fix test for slow windows + add newer golang versions
2 parents 01d7e00 + ac94eb5 commit 0eeb96f

File tree

4 files changed

+85
-13
lines changed

4 files changed

+85
-13
lines changed

.github/workflows/workflow.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ jobs:
1010
golangci-lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/setup-go@v4
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-go@v5
1415
with:
15-
go-version: 1.18
16-
- uses: actions/checkout@v3
16+
go-version: stable
1717
- name: golangci-lint
18-
uses: golangci/golangci-lint-action@v3
18+
uses: golangci/golangci-lint-action@v6
1919
with:
2020
version: latest
2121
tests:
2222
runs-on: ${{ matrix.os }}
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
go-version: ['1.18', '1.19', '1.20']
26+
go-version: ['1.20', '1.21', '1.22', '1.23', '1.24']
2727
os: [ubuntu-latest, macos-latest, windows-latest]
2828
env:
2929
OS: ${{ matrix.os }}
3030
GOVERSION: ${{ matrix.go-version }}
3131
steps:
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3333
- name: Setup Go ${{ matrix.go-version }}
34-
uses: actions/setup-go@v4
34+
uses: actions/setup-go@v5
3535
with:
3636
go-version: ${{ matrix.go-version }}
3737
check-latest: true
@@ -43,9 +43,9 @@ jobs:
4343
- name: Test
4444
run: make ci
4545
- name: Archive code coverage results
46-
uses: actions/upload-artifact@v3
46+
uses: actions/upload-artifact@v4
4747
with:
48-
name: code-coverage-report-${{ matrix.os }}
48+
name: code-coverage-report-${{ matrix.os }}-${{ matrix.go-version }}
4949
path: coverage.txt
5050

5151
coverage:
@@ -54,11 +54,11 @@ jobs:
5454

5555
steps:
5656
- name: Download a linux coverage report
57-
uses: actions/download-artifact@v3
57+
uses: actions/download-artifact@v4
5858
with:
59-
name: code-coverage-report-ubuntu-latest
59+
name: code-coverage-report-ubuntu-latest-1.24
6060
- name: Upload coverage to Codecov
61-
uses: codecov/codecov-action@v3
61+
uses: codecov/codecov-action@v4
6262
with:
6363
token: ${{ secrets.CODECOV_TOKEN }}
6464
fail_ci_if_error: true

current.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
goos: darwin
2+
goarch: amd64
3+
pkg: github.com/avast/retry-go/v4
4+
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
5+
BenchmarkDo-16 3 474128987 ns/op 2730 B/op 48 allocs/op
6+
BenchmarkDo-16 3 441499631 ns/op 2725 B/op 47 allocs/op
7+
BenchmarkDo-16 3 449390845 ns/op 2693 B/op 47 allocs/op
8+
BenchmarkDo-16 3 488695333 ns/op 2725 B/op 47 allocs/op
9+
BenchmarkDo-16 2 601685067 ns/op 2704 B/op 48 allocs/op
10+
BenchmarkDo-16 3 336872997 ns/op 2693 B/op 47 allocs/op
11+
BenchmarkDo-16 3 384347911 ns/op 2725 B/op 47 allocs/op
12+
BenchmarkDo-16 3 480906307 ns/op 2693 B/op 47 allocs/op
13+
BenchmarkDo-16 3 455362447 ns/op 2693 B/op 47 allocs/op
14+
BenchmarkDo-16 3 443170384 ns/op 2693 B/op 47 allocs/op
15+
BenchmarkDoNoErrors-16 6872852 159.4 ns/op 208 B/op 4 allocs/op
16+
BenchmarkDoNoErrors-16 7650360 161.3 ns/op 208 B/op 4 allocs/op
17+
BenchmarkDoNoErrors-16 7235683 159.3 ns/op 208 B/op 4 allocs/op
18+
BenchmarkDoNoErrors-16 7465636 160.2 ns/op 208 B/op 4 allocs/op
19+
BenchmarkDoNoErrors-16 7549692 160.7 ns/op 208 B/op 4 allocs/op
20+
BenchmarkDoNoErrors-16 7510610 159.8 ns/op 208 B/op 4 allocs/op
21+
BenchmarkDoNoErrors-16 7438124 160.3 ns/op 208 B/op 4 allocs/op
22+
BenchmarkDoNoErrors-16 7416504 160.2 ns/op 208 B/op 4 allocs/op
23+
BenchmarkDoNoErrors-16 7356183 160.4 ns/op 208 B/op 4 allocs/op
24+
BenchmarkDoNoErrors-16 7393480 160.1 ns/op 208 B/op 4 allocs/op
25+
PASS
26+
ok github.com/avast/retry-go/v4 35.971s

generic.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
goos: darwin
2+
goarch: amd64
3+
pkg: github.com/avast/retry-go/v4
4+
cpu: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
5+
BenchmarkDo-16 3 406306609 ns/op 2701 B/op 48 allocs/op
6+
BenchmarkDo-16 3 419470846 ns/op 2693 B/op 47 allocs/op
7+
BenchmarkDo-16 2 567716303 ns/op 2696 B/op 47 allocs/op
8+
BenchmarkDo-16 2 562713288 ns/op 2696 B/op 47 allocs/op
9+
BenchmarkDo-16 3 418301987 ns/op 2693 B/op 47 allocs/op
10+
BenchmarkDo-16 2 541207332 ns/op 2696 B/op 47 allocs/op
11+
BenchmarkDo-16 2 526211617 ns/op 2696 B/op 47 allocs/op
12+
BenchmarkDo-16 2 517419526 ns/op 2696 B/op 47 allocs/op
13+
BenchmarkDo-16 3 478391497 ns/op 2693 B/op 47 allocs/op
14+
BenchmarkDo-16 3 452548175 ns/op 2725 B/op 47 allocs/op
15+
BenchmarkDoWithData-16 3 463040866 ns/op 2693 B/op 47 allocs/op
16+
BenchmarkDoWithData-16 3 496158943 ns/op 2693 B/op 47 allocs/op
17+
BenchmarkDoWithData-16 3 488367012 ns/op 2725 B/op 47 allocs/op
18+
BenchmarkDoWithData-16 3 454618897 ns/op 2693 B/op 47 allocs/op
19+
BenchmarkDoWithData-16 3 435430056 ns/op 2693 B/op 47 allocs/op
20+
BenchmarkDoWithData-16 2 552289967 ns/op 2744 B/op 48 allocs/op
21+
BenchmarkDoWithData-16 3 569748815 ns/op 2693 B/op 47 allocs/op
22+
BenchmarkDoWithData-16 3 416597207 ns/op 2725 B/op 47 allocs/op
23+
BenchmarkDoWithData-16 3 358455415 ns/op 2725 B/op 47 allocs/op
24+
BenchmarkDoWithData-16 3 455297803 ns/op 2725 B/op 47 allocs/op
25+
BenchmarkDoNoErrors-16 7035135 161.9 ns/op 208 B/op 4 allocs/op
26+
BenchmarkDoNoErrors-16 7389806 161.3 ns/op 208 B/op 4 allocs/op
27+
BenchmarkDoNoErrors-16 7394016 161.5 ns/op 208 B/op 4 allocs/op
28+
BenchmarkDoNoErrors-16 7380039 162.2 ns/op 208 B/op 4 allocs/op
29+
BenchmarkDoNoErrors-16 7424865 162.2 ns/op 208 B/op 4 allocs/op
30+
BenchmarkDoNoErrors-16 7111860 160.5 ns/op 208 B/op 4 allocs/op
31+
BenchmarkDoNoErrors-16 7285305 162.6 ns/op 208 B/op 4 allocs/op
32+
BenchmarkDoNoErrors-16 7410627 160.7 ns/op 208 B/op 4 allocs/op
33+
BenchmarkDoNoErrors-16 7340961 161.6 ns/op 208 B/op 4 allocs/op
34+
BenchmarkDoNoErrors-16 7295727 164.1 ns/op 208 B/op 4 allocs/op
35+
BenchmarkDoWithDataNoErrors-16 7357304 159.9 ns/op 208 B/op 4 allocs/op
36+
BenchmarkDoWithDataNoErrors-16 6649852 166.9 ns/op 208 B/op 4 allocs/op
37+
BenchmarkDoWithDataNoErrors-16 6938404 176.3 ns/op 208 B/op 4 allocs/op
38+
BenchmarkDoWithDataNoErrors-16 7181965 160.4 ns/op 208 B/op 4 allocs/op
39+
BenchmarkDoWithDataNoErrors-16 7311484 166.2 ns/op 208 B/op 4 allocs/op
40+
BenchmarkDoWithDataNoErrors-16 6939157 169.7 ns/op 208 B/op 4 allocs/op
41+
BenchmarkDoWithDataNoErrors-16 6648344 179.0 ns/op 208 B/op 4 allocs/op
42+
BenchmarkDoWithDataNoErrors-16 6794847 177.0 ns/op 208 B/op 4 allocs/op
43+
BenchmarkDoWithDataNoErrors-16 6782588 171.4 ns/op 208 B/op 4 allocs/op
44+
BenchmarkDoWithDataNoErrors-16 7279119 166.9 ns/op 208 B/op 4 allocs/op
45+
PASS
46+
ok github.com/avast/retry-go/v4 73.128s

retry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func TestMaxDelay(t *testing.T) {
278278
dur := time.Since(start)
279279
assert.Error(t, err)
280280
assert.Greater(t, dur, 120*time.Millisecond, "5 times with maximum delay retry is less than 120ms")
281-
assert.Less(t, dur, 250*time.Millisecond, "5 times with maximum delay retry is longer than 250ms")
281+
assert.Less(t, dur, 275*time.Millisecond, "5 times with maximum delay retry is longer than 275ms")
282282
}
283283

284284
func TestBackOffDelay(t *testing.T) {

0 commit comments

Comments
 (0)