Skip to content

Commit

Permalink
Fix data race,ref #4857
Browse files Browse the repository at this point in the history
Signed-off-by: v01dstar <[email protected]>
  • Loading branch information
v01dstar committed May 20, 2022
1 parent 9f1894a commit 778defc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/cluster/unsafe_recovery_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1316,17 +1316,17 @@ func (s *testUnsafeRecoverySuite) TestRemoveFailedStores(c *C) {
func (s *testUnsafeRecoverySuite) TestSplitPaused(c *C) {
_, opt, _ := newTestScheduleConfig()
cluster := newTestRaftCluster(s.ctx, mockid.NewIDAllocator(), opt, storage.NewStorageWithMemoryBackend(), core.NewBasicCluster())
recoveryController := newUnsafeRecoveryController(cluster)
cluster.Lock()
cluster.unsafeRecoveryController = recoveryController
cluster.coordinator = newCoordinator(s.ctx, cluster, hbstream.NewTestHeartbeatStreams(s.ctx, cluster.meta.GetId(), cluster, true))
cluster.Unlock()
cluster.coordinator.run()
stores := newTestStores(2, "5.3.0")
stores[1] = stores[1].Clone(core.SetLastHeartbeatTS(time.Now()))
for _, store := range stores {
c.Assert(cluster.PutStore(store.GetMeta()), IsNil)
}
recoveryController := newUnsafeRecoveryController(cluster)
cluster.Lock()
cluster.unsafeRecoveryController = recoveryController
cluster.Unlock()
failedStores := map[uint64]struct{}{
1: {},
}
Expand Down

0 comments on commit 778defc

Please sign in to comment.