Codebase list golang-github-vbauerster-mpb / 04400eb
Fix Abort method usage Vladimir Bauer 7 years ago
3 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
4747 t.Errorf("Expected bar id: %d, got %d\n", wantID, gotID)
4848 }
4949
50 p.Abort(bar)
50 p.Abort(bar, true)
5151 p.Wait()
5252 }
5353
4242 for i := 0; i < total; i++ {
4343 start := time.Now()
4444 if b.ID() == 2 && i == 42 {
45 p.Abort(b)
45 p.Abort(b, true)
4646 return
4747 }
4848 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
4444 t.Errorf("BarCount want: %q, got: %q\n", 1, count)
4545 }
4646
47 p.Abort(b)
47 p.Abort(b, true)
4848 p.Wait()
4949 }
5050
6060 go func(n int) {
6161 for i := 0; i < 100; i++ {
6262 if n == 0 && i == 33 {
63 p.Abort(b)
63 p.Abort(b, true)
6464 wg.Done()
6565 }
6666 b.Increment()
7474 if count != 2 {
7575 t.Errorf("BarCount want: %q, got: %q\n", 2, count)
7676 }
77 p.Abort(bars[1])
78 p.Abort(bars[2])
77 p.Abort(bars[1], true)
78 p.Abort(bars[2], true)
7979 p.Wait()
8080 }
8181
119119
120120 for i := 0; i < 100; i++ {
121121 if i == 33 {
122 p.Abort(bar)
122 p.Abort(bar, true)
123123 break
124124 }
125125 time.Sleep(randomDuration(100 * time.Millisecond))