(t *testing.T)
| 428 | } |
| 429 | |
| 430 | func TestSendProcess_ConcurrentShutdown(t *testing.T) { |
| 431 | ctx, cancel := context.WithCancel(context.Background()) |
| 432 | pool := newTestBasePool(ctx, cancel) |
| 433 | |
| 434 | var ext sync.WaitGroup |
| 435 | for i := 0; i < 200; i++ { |
| 436 | ext.Add(1) |
| 437 | go func() { |
| 438 | defer ext.Done() |
| 439 | pool.sendProcess(newTestBaseline()) |
| 440 | }() |
| 441 | } |
| 442 | |
| 443 | time.Sleep(2 * time.Millisecond) |
| 444 | cancel() |
| 445 | |
| 446 | go func() { |
| 447 | for range pool.processCh { |
| 448 | } |
| 449 | }() |
| 450 | |
| 451 | mustFinish(t, 5*time.Second, "concurrent sendProcess+cancel hung", func() { |
| 452 | ext.Wait() |
| 453 | }) |
| 454 | close(pool.processCh) |
| 455 | } |
| 456 | |
| 457 | // --------------------------------------------------------------------------- |
| 458 | // putToOutput |
nothing calls this directly
no test coverage detected