Skip to content

Commit

Permalink
api: fix the testServiceSuite (#5096)
Browse files Browse the repository at this point in the history
ref #4813

Fix the `testServiceSuite`.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato authored Jun 2, 2022
1 parent fc55b44 commit d114cd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
19 changes: 0 additions & 19 deletions server/api/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
8 changes: 4 additions & 4 deletions server/api/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,22 +154,22 @@ 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})

mustBootstrapCluster(c, s.svr)
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()
}

Expand Down

0 comments on commit d114cd6

Please sign in to comment.