| 1 |
From: Santiago Vila <[email protected]> |
| 2 |
Subject: Use at least 2 workers in TestPool_NewJob |
| 3 |
Bug-Debian: https://bugs.debian.org/1102302 |
| 4 |
|
| 5 |
--- a/pool_test.go |
| 6 |
+++ b/pool_test.go |
| 7 |
@@ -14,7 +14,12 @@ |
| 8 |
) |
| 9 |
|
| 10 |
func TestPool_NewJob(t *testing.T) { |
| 11 |
- doubler := newDoubler(runtime.NumCPU()) |
| 12 |
+ workers := runtime.NumCPU() |
| 13 |
+ if workers < 2 { |
| 14 |
+ workers = 2 |
| 15 |
+ } |
| 16 |
+ |
| 17 |
+ doubler := newDoubler(workers) |
| 18 |
defer doubler.Done() |
| 19 |
|
| 20 |
job1, done1, err := doubler.newJob(context.Background(), 1) |