Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvserver: remove multiTestContext #61561

Merged
merged 1 commit into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkg/kv/kvserver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,10 @@ go_test(
"//pkg/config",
"//pkg/config/zonepb",
"//pkg/gossip",
"//pkg/gossip/resolver",
"//pkg/keys",
"//pkg/kv",
"//pkg/kv/kvclient",
"//pkg/kv/kvclient/kvcoord",
"//pkg/kv/kvclient/rangecache",
"//pkg/kv/kvserver/abortspan",
"//pkg/kv/kvserver/apply",
"//pkg/kv/kvserver/batcheval",
Expand Down Expand Up @@ -374,7 +372,6 @@ go_test(
"//pkg/util/timeutil",
"//pkg/util/tracing",
"//pkg/util/uuid",
"@com_github_cenkalti_backoff//:backoff",
"@com_github_cockroachdb_circuitbreaker//:circuitbreaker",
"@com_github_cockroachdb_cockroach_go//crdb",
"@com_github_cockroachdb_datadriven//:datadriven",
Expand Down
30 changes: 0 additions & 30 deletions pkg/kv/kvserver/client_raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1763,36 +1763,6 @@ func TestStoreRangeUpReplicate(t *testing.T) {
}
}

// TestUnreplicateFirstRange verifies that multiTestContext still functions in
// the case where the first range (which contains range metadata) is
// unreplicated from the first store. This situation can arise occasionally in
// tests, as can a similar situation where the first store is no longer the lease holder of
// the first range; this verifies that those tests will not be affected.
// TODO(lunevalex): Remove this test when removing MTC, no need to convert it
func TestUnreplicateFirstRange(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

cfg := kvserver.TestStoreConfig(nil)
cfg.TestingKnobs.DisableReplicateQueue = true
mtc := &multiTestContext{storeConfig: &cfg}
defer mtc.Stop()
mtc.Start(t, 3)

const rangeID = roachpb.RangeID(1)
// Replicate the range to store 1.
mtc.replicateRange(rangeID, 1)
// Move the lease away from store 0 before removing its replica.
mtc.transferLease(context.Background(), rangeID, 0, 1)
// Unreplicate the from from store 0.
mtc.unreplicateRange(rangeID, 0)
require.NoError(t, mtc.waitForUnreplicated(rangeID, 0))
// Replicate the range to store 2. The first range is no longer available on
// store 1, and this command will fail if that situation is not properly
// supported.
mtc.replicateRange(rangeID, 2)
}

// TestChangeReplicasDescriptorInvariant tests that a replica change aborts if
// another change has been made to the RangeDescriptor since it was initiated.
func TestChangeReplicasDescriptorInvariant(t *testing.T) {
Expand Down
Loading