diff --git a/tests/server/id/id_test.go b/tests/server/id/id_test.go index 749f26c7f9d..1eb90f83e29 100644 --- a/tests/server/id/id_test.go +++ b/tests/server/id/id_test.go @@ -183,6 +183,7 @@ func (s *testAllocIDSuite) TestPDRestart(c *C) { c.Assert(leaderServer.Stop(), IsNil) c.Assert(leaderServer.Run(), IsNil) + cluster.WaitLeader() for i := uint64(0); i < 10; i++ { id, err := leaderServer.GetAllocator().Alloc()