Skip to content

Commit 06f15e7

Browse files
committed
util/retry: fix expected time for immediate cancellation
When context/closer is canceled before retry loop, no backoff time elapses due to two-stage select prioritization. Release note: None
1 parent 2b7d596 commit 06f15e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/util/retry/retry_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func TestRetryWithMaxDuration(t *testing.T) {
469469
preRetryFunc: func() {
470470
cancelCtxFunc()
471471
},
472-
expectedTimeSpent: time.Millisecond,
472+
expectedTimeSpent: 0,
473473
expectedErr: true,
474474
},
475475
{
@@ -486,7 +486,7 @@ func TestRetryWithMaxDuration(t *testing.T) {
486486
preRetryFunc: func() {
487487
close(closeCh)
488488
},
489-
expectedTimeSpent: time.Millisecond,
489+
expectedTimeSpent: 0,
490490
expectedErr: true,
491491
},
492492
}

0 commit comments

Comments
 (0)