diff --git a/server/cluster/unsafe_recovery_controller_test.go b/server/cluster/unsafe_recovery_controller_test.go index 1e99c483519..03d545ae50b 100644 --- a/server/cluster/unsafe_recovery_controller_test.go +++ b/server/cluster/unsafe_recovery_controller_test.go @@ -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: {}, }