Skip to content

Commit 71f8187

Browse files
committed
fix lint
1 parent 4081446 commit 71f8187

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

retry.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ func (b *Backoff) validateAndFreeze() {
131131
}
132132

133133
// freeze
134-
rand.Seed(time.Now().Unix())
135134
b.attempts = b.Attempts
136135
b.initialDelay = b.InitialDelay
137136
b.maxDelay = b.MaxDelay

retry_internal_test.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,25 @@ func TestFreezeBackoffAfterFirstUse(t *testing.T) {
2121
Jitter: jitter,
2222
}
2323

24-
Run(context.Background(), b, func(ctx context.Context) error {
24+
err := Run(context.Background(), b, func(ctx context.Context) error {
2525
return nil
2626
})
27+
if err != nil {
28+
t.Errorf("expected no error, got %v", err)
29+
}
2730

2831
b.Attempts = 7
2932
b.InitialDelay = 7 * time.Millisecond
3033
b.MaxDelay = 7 * time.Millisecond
3134
b.Factor = 7.0
3235
b.Jitter = 7.0
3336

34-
Run(context.Background(), b, func(ctx context.Context) error {
37+
err = Run(context.Background(), b, func(ctx context.Context) error {
3538
return nil
3639
})
40+
if err != nil {
41+
t.Errorf("expected no error, got %v", err)
42+
}
3743

3844
if b.Attempts != 7 || b.attempts != attempts ||
3945
b.InitialDelay != 7*time.Millisecond || b.initialDelay != initialDelay ||
@@ -59,9 +65,12 @@ func TestFreezeBackoffWithBadInputs(t *testing.T) {
5965
Jitter: jitter,
6066
}
6167

62-
Run(context.Background(), b, func(ctx context.Context) error {
68+
err := Run(context.Background(), b, func(ctx context.Context) error {
6369
return nil
6470
})
71+
if err != nil {
72+
t.Errorf("expected no error, got %v", err)
73+
}
6574

6675
if b.attempts != 1 ||
6776
b.initialDelay != 0 ||

0 commit comments

Comments
 (0)