Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
WangXiangUSTC committed Feb 3, 2020
1 parent ce3635a commit 7802a15
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dm/worker/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ var _ = Suite(&testServer{})
func (t *testServer) SetUpSuite(c *C) {
err := log.InitLogger(&log.Config{})
c.Assert(err, IsNil)

getMinPosForSubTaskFunc = getFakePosForSubTask
}

func (t *testServer) TearDownSuite(c *C) {
getMinPosForSubTaskFunc = getMinPosForSubTask
}

func createMockETCD(dir string, host string) (*embed.Etcd, error) {
Expand Down Expand Up @@ -325,12 +331,6 @@ func (t *testServer) testStopWorkerWhenLostConnect(c *C, s *Server, ETCD *embed.
}

func (t *testServer) TestGetMinPosInAllSubTasks(c *C) {
originFunc := getMinPosForSubTaskFunc
getMinPosForSubTaskFunc = getFakePosForSubTask
defer func() {
getMinPosForSubTaskFunc = originFunc
}()

subTaskCfg := []*config.SubTaskConfig{
{
Name: "test2",
Expand Down

0 comments on commit 7802a15

Please sign in to comment.