Skip to content

Commit

Permalink
Merge #32609
Browse files Browse the repository at this point in the history
32609: storage: deflake TestStoreRangeMergeSlowAbandonedFollower r=tschottdorf a=benesch

This test needs to wait for store2 to process the split before it blocks
traffic to the LHS of the merge. The old approach admitted a race where
it would proceed before store2's replica of the RHS was initialized.

Fix #32590.

Release note: None

Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
  • Loading branch information
craig[bot] and benesch committed Nov 26, 2018
2 parents 69ad6b8 + 6e9bc2d commit 2ddc528
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/storage/client_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1815,8 +1815,10 @@ func TestStoreRangeMergeSlowAbandonedFollower(t *testing.T) {
// Wait for store2 to hear about the split.
var rhsRepl2 *storage.Replica
testutils.SucceedsSoon(t, func() error {
rhsRepl2, err = store2.GetReplica(rhsDesc.RangeID)
return err
if rhsRepl2, err = store2.GetReplica(rhsDesc.RangeID); err != nil || !rhsRepl2.IsInitialized() {
return errors.New("store2 has not yet processed split")
}
return nil
})

// Block Raft traffic to the LHS replica on store2, by holding its raftMu, so
Expand Down

0 comments on commit 2ddc528

Please sign in to comment.