Skip to content

Commit

Permalink
Merge #28634
Browse files Browse the repository at this point in the history
28634: server: Fix EnqueueRange test flake r=a-robinson a=a-robinson

The test could flake if a range lease got transferred during one of the
test cases in such a way that none of the stores confidently owned the
lease at the time that the request made it to them. To fix the flake,
just disable automatic replication / lease transfers in the test.

Fixes #28610

Release note: None

Co-authored-by: Alex Robinson <[email protected]>
  • Loading branch information
craig[bot] and a-robinson committed Aug 16, 2018
2 parents eae6a56 + 5315a20 commit 5f0d11e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/server/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1475,9 +1475,19 @@ func BenchmarkAdminAPIDataDistribution(b *testing.B) {

func TestEnqueueRange(t *testing.T) {
defer leaktest.AfterTest(t)()
testCluster := serverutils.StartTestCluster(t, 3, base.TestClusterArgs{})
testCluster := serverutils.StartTestCluster(t, 3, base.TestClusterArgs{
ReplicationMode: base.ReplicationManual,
})
defer testCluster.Stopper().Stop(context.Background())

// Up-replicate r1 to all 3 nodes. We use manual replication to avoid lease
// transfers causing temporary conditions in which no store is the
// leaseholder, which can break the the tests below.
_, err := testCluster.AddReplicas(roachpb.KeyMin, testCluster.Target(1), testCluster.Target(2))
if err != nil {
t.Fatal(err)
}

// RangeID being queued
const realRangeID = 1
const fakeRangeID = 999
Expand Down

0 comments on commit 5f0d11e

Please sign in to comment.