Skip to content

Commit

Permalink
kvserver: remove multiTestContext
Browse files Browse the repository at this point in the history
Closes cockroachdb#8299

With all the tests converted to use TestCluster/TestServer,
we can finally remove multiTestContext and all of the dependent
code.

Release note: None
  • Loading branch information
lunevalex committed Feb 5, 2021
1 parent 624cc58 commit fbdade8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 1,355 deletions.
3 changes: 0 additions & 3 deletions pkg/kv/kvserver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,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 @@ -367,7 +365,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

0 comments on commit fbdade8

Please sign in to comment.