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

test: fix TestPauseAndResumeSubtask #805

Merged
merged 3 commits into from
Jul 17, 2020
Merged
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions dm/worker/subtask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,13 @@ func (t *testSubTask) TestPauseAndResumeSubtask(c *C) {

// fail dumper
c.Assert(mockDumper.InjectProcessError(context.Background(), errors.New("dumper process error")), IsNil)
for i := 0; i < 1000; i++ {
// InjectProcessError need 1 second, here we wait 1.5 second
for i := 0; i < 15; i++ {
res := st.Result()
if res != nil {
break
}
time.Sleep(time.Millisecond)
time.Sleep(100 * time.Millisecond)
}
c.Assert(st.CurrUnit(), Equals, mockDumper)
c.Assert(st.Result(), NotNil)
Expand Down