Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
98750: rangefeed: handle variadic args in `TestBackoffOnRangefeedFailure` r=erikgrinaker a=erikgrinaker

The rangefeed will metamorphically enable the `MuxRangefeed` protocol by adding a variadic option. This patch allows arbitrary variadic options in `TestBackoffOnRangefeedFailure` mocks.

Resolves cockroachdb#97725.

Epic: none
Release note: None

Co-authored-by: Erik Grinaker <grinaker@cockroachlabs.com>
  • Loading branch information
craig[bot] and erikgrinaker committed Mar 16, 2023
2 parents 12d4120 + 5b0f45a commit 87c0fd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion pkg/kv/kvclient/rangefeed/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ go_test(
"//pkg/storage",
"//pkg/testutils",
"//pkg/testutils/serverutils",
"//pkg/testutils/skip",
"//pkg/testutils/sqlutils",
"//pkg/testutils/storageutils",
"//pkg/testutils/testcluster",
Expand Down
7 changes: 2 additions & 5 deletions pkg/kv/kvclient/rangefeed/rangefeed_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/kv/kvclient/rangefeed"
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/retry"
Expand Down Expand Up @@ -350,8 +349,6 @@ func TestRangeFeedMock(t *testing.T) {
func TestBackoffOnRangefeedFailure(t *testing.T) {
defer leaktest.AfterTest(t)()

skip.WithIssue(t, 97725, "flaky test")

ctx, cancel := context.WithCancel(context.Background())
stopper := stop.NewStopper()
defer stopper.Stop(ctx)
Expand All @@ -365,10 +362,10 @@ func TestBackoffOnRangefeedFailure(t *testing.T) {

// Make sure rangefeed is retried even after 3 failures, then succeed and cancel context
// (which signals the rangefeed to shut down gracefully).
db.EXPECT().RangeFeed(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
db.EXPECT().RangeFeed(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Times(3).
Return(errors.New("rangefeed failed"))
db.EXPECT().RangeFeed(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
db.EXPECT().RangeFeed(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Do(func(context.Context, []roachpb.Span, hlc.Timestamp, bool, chan<- kvcoord.RangeFeedMessage, ...kvcoord.RangeFeedOption) {
cancel()
}).
Expand Down

0 comments on commit 87c0fd5

Please sign in to comment.