Fix Abort method usage
Vladimir Bauer
7 years ago
| 42 | 42 |
for i := 0; i < total; i++ {
|
| 43 | 43 |
start := time.Now()
|
| 44 | 44 |
if b.ID() == 2 && i == 42 {
|
| 45 | |
p.Abort(b)
|
|
45 |
p.Abort(b, true)
|
| 46 | 46 |
return
|
| 47 | 47 |
}
|
| 48 | 48 |
time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
|
| 44 | 44 |
t.Errorf("BarCount want: %q, got: %q\n", 1, count)
|
| 45 | 45 |
}
|
| 46 | 46 |
|
| 47 | |
p.Abort(b)
|
|
47 |
p.Abort(b, true)
|
| 48 | 48 |
p.Wait()
|
| 49 | 49 |
}
|
| 50 | 50 |
|
|
| 60 | 60 |
go func(n int) {
|
| 61 | 61 |
for i := 0; i < 100; i++ {
|
| 62 | 62 |
if n == 0 && i == 33 {
|
| 63 | |
p.Abort(b)
|
|
63 |
p.Abort(b, true)
|
| 64 | 64 |
wg.Done()
|
| 65 | 65 |
}
|
| 66 | 66 |
b.Increment()
|
|
| 74 | 74 |
if count != 2 {
|
| 75 | 75 |
t.Errorf("BarCount want: %q, got: %q\n", 2, count)
|
| 76 | 76 |
}
|
| 77 | |
p.Abort(bars[1])
|
| 78 | |
p.Abort(bars[2])
|
|
77 |
p.Abort(bars[1], true)
|
|
78 |
p.Abort(bars[2], true)
|
| 79 | 79 |
p.Wait()
|
| 80 | 80 |
}
|
| 81 | 81 |
|
|
| 119 | 119 |
|
| 120 | 120 |
for i := 0; i < 100; i++ {
|
| 121 | 121 |
if i == 33 {
|
| 122 | |
p.Abort(bar)
|
|
122 |
p.Abort(bar, true)
|
| 123 | 123 |
break
|
| 124 | 124 |
}
|
| 125 | 125 |
time.Sleep(randomDuration(100 * time.Millisecond))
|