Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(dm): try fix testMaster.TestStartTaskWithRemoveMeta #4306

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions dm/dm/master/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,6 @@ func (t *testMaster) TestStartTaskWithRemoveMeta(c *check.C) {
wg.Add(1)
go func() {
defer wg.Done()
time.Sleep(10 * time.Microsecond)
// start another same task at the same time, should get err
verMock2 := conn.InitVersionDB(c)
verMock2.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).
Expand All @@ -1010,9 +1009,7 @@ func (t *testMaster) TestStartTaskWithRemoveMeta(c *check.C) {
"while remove-meta is true").Error())
}()
c.Assert(err, check.IsNil)
if !resp.Result {
c.Errorf("start task failed: %s", resp.Msg)
}
c.Assert(resp.Result, check.IsTrue)
for _, source := range sources {
t.subTaskStageMatch(c, server.scheduler, taskName, source, pb.Stage_Running)
tcm, _, err2 := ha.GetSubTaskCfg(t.etcdTestCli, source, taskName, 0)
Expand Down Expand Up @@ -1091,7 +1088,6 @@ func (t *testMaster) TestStartTaskWithRemoveMeta(c *check.C) {
wg.Add(1)
go func() {
defer wg.Done()
time.Sleep(10 * time.Microsecond)
// start another same task at the same time, should get err
vermock2 := conn.InitVersionDB(c)
vermock2.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).
Expand Down