File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ||
You can’t perform that action at this time.
0 commit comments