diff --git a/server/api/admin_test.go b/server/api/admin_test.go index 3be3b38b484..1ece28a5239 100644 --- a/server/api/admin_test.go +++ b/server/api/admin_test.go @@ -170,22 +170,3 @@ func (s *testTSOSuite) TestResetTS(c *C) { tu.StringEqual(c, "\"invalid tso value\"\n")) c.Assert(err, IsNil) } - -var _ = Suite(&testServiceSuite{}) - -type testServiceSuite struct { - svr *server.Server - cleanup cleanUpFunc -} - -func (s *testServiceSuite) SetUpSuite(c *C) { - s.svr, s.cleanup = mustNewServer(c) - mustWaitLeader(c, []*server.Server{s.svr}) - - mustBootstrapCluster(c, s.svr) - mustPutStore(c, s.svr, 1, metapb.StoreState_Up, metapb.NodeState_Serving, nil) -} - -func (s *testServiceSuite) TearDownSuite(c *C) { - s.cleanup() -} diff --git a/server/api/server_test.go b/server/api/server_test.go index 51467db3938..8d9f1b4c227 100644 --- a/server/api/server_test.go +++ b/server/api/server_test.go @@ -154,14 +154,14 @@ func mustBootstrapCluster(c *C, s *server.Server) { c.Assert(resp.GetHeader().GetError().GetType(), Equals, pdpb.ErrorType_OK) } -var _ = Suite(&testServerServiceSuite{}) +var _ = Suite(&testServiceSuite{}) -type testServerServiceSuite struct { +type testServiceSuite struct { svr *server.Server cleanup cleanUpFunc } -func (s *testServerServiceSuite) SetUpSuite(c *C) { +func (s *testServiceSuite) SetUpSuite(c *C) { s.svr, s.cleanup = mustNewServer(c) mustWaitLeader(c, []*server.Server{s.svr}) @@ -169,7 +169,7 @@ func (s *testServerServiceSuite) SetUpSuite(c *C) { mustPutStore(c, s.svr, 1, metapb.StoreState_Up, metapb.NodeState_Serving, nil) } -func (s *testServerServiceSuite) TearDownSuite(c *C) { +func (s *testServiceSuite) TearDownSuite(c *C) { s.cleanup() }