Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
restore: fix build break
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed May 27, 2020
1 parent 57352bb commit cc3cae7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/restore/backoff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ func (s *testBackofferSuite) TearDownSuite(c *C) {

func (s *testBackofferSuite) TestBackoffWithSuccess(c *C) {
var counter int
backoffer := &newImportSSTBackoffer{attemp: 10, delayTime: time.Nanosecond, maxDelayTime: time.Nanosecond}
backoffer := &importerBackoffer{attempt: 10, delayTime: time.Nanosecond, maxDelayTime: time.Nanosecond}
err := utils.WithRetry(context.Background(), func() error {
defer func() { counter++ }()
switch counter {
case 0:
return errGRPC
return errGrpc
case 1:
return errEpochNotMatch
case 2:
Expand All @@ -51,7 +51,7 @@ func (s *testBackofferSuite) TestBackoffWithSuccess(c *C) {

func (s *testBackofferSuite) TestBackoffWithFatalError(c *C) {
var counter int
backoffer := &newImportSSTBackoffer{attemp: 10, delayTime: time.Nanosecond, maxDelayTime: time.Nanosecond}
backoffer := &importerBackoffer{attempt: 10, delayTime: time.Nanosecond, maxDelayTime: time.Nanosecond}
err := utils.WithRetry(context.Background(), func() error {
defer func() { counter++ }()
switch counter {
Expand All @@ -68,7 +68,7 @@ func (s *testBackofferSuite) TestBackoffWithFatalError(c *C) {
}, backoffer)
c.Assert(counter, Equals, 4)
c.Assert(multierr.Errors(err), DeepEquals, []error{
errGRPC,
errGrpc,
errEpochNotMatch,
errDownloadFailed,
errRangeIsEmpty,
Expand All @@ -77,11 +77,11 @@ func (s *testBackofferSuite) TestBackoffWithFatalError(c *C) {

func (s *testBackofferSuite) TestBackoffWithRetryableError(c *C) {
var counter int
backoffer := &newImportSSTBackoffer{attemp: 10, delayTime: time.Nanosecond, maxDelayTime: time.Nanosecond}
backoffer := &importerBackoffer{attempt: 10, delayTime: time.Nanosecond, maxDelayTime: time.Nanosecond}
err := utils.WithRetry(context.Background(), func() error {
defer func() { counter++ }()
return errEpochNotMatch
}, &backoffer)
}, backoffer)
c.Assert(counter, Equals, 10)
c.Assert(multierr.Errors(err), DeepEquals, []error{
errEpochNotMatch,
Expand Down

0 comments on commit cc3cae7

Please sign in to comment.