Skip to content

Commit

Permalink
test add
Browse files Browse the repository at this point in the history
  • Loading branch information
谢小军 authored and 谢小军 committed Sep 15, 2019
1 parent 7239ebf commit 324474a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workerpool/workerpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestWorkerPoolStart(t *testing.T) {
wp.Do(func() error {
for j := 0; j < 10; j++ {
fmt.Println(fmt.Sprintf("%v->\t%v", ii, j))
time.Sleep(1 * time.Second)
time.Sleep(1 * time.Millisecond)
}
//time.Sleep(1 * time.Second)
return nil
Expand All @@ -39,7 +39,7 @@ func TestWorkerPoolError(t *testing.T) {
if ii == 1 {
return errors.Cause(errors.New("my test err")) //有err 立即返回
}
time.Sleep(1 * time.Second)
time.Sleep(1 * time.Millisecond)
}

return nil
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestWorkerPoolDoWait(t *testing.T) {
// if ii == 1 {
// return errors.New("my test err")
// }
time.Sleep(1 * time.Second)
time.Sleep(1 * time.Millisecond)
}

return nil
Expand All @@ -92,7 +92,7 @@ func TestWorkerPoolIsDone(t *testing.T) {
wp.Do(func() error {
for j := 0; j < 5; j++ {
//fmt.Println(fmt.Sprintf("%v->\t%v", ii, j))
time.Sleep(1 * time.Second)
time.Sleep(1 * time.Millisecond)
}
return nil
})
Expand Down

0 comments on commit 324474a

Please sign in to comment.