(t *testing.T)
| 636 | } |
| 637 | |
| 638 | func TestHandlerDone_ProcessesAllBeforeExit(t *testing.T) { |
| 639 | ctx, cancel := context.WithCancel(context.Background()) |
| 640 | defer cancel() |
| 641 | pool := newTestBasePool(ctx, cancel) |
| 642 | |
| 643 | var count int |
| 644 | go func() { |
| 645 | defer close(pool.handlerDone) |
| 646 | for range pool.processCh { |
| 647 | count++ |
| 648 | } |
| 649 | }() |
| 650 | |
| 651 | const N = 20 |
| 652 | for i := 0; i < N; i++ { |
| 653 | pool.processCh <- newTestBaseline() |
| 654 | } |
| 655 | close(pool.processCh) |
| 656 | <-pool.handlerDone |
| 657 | |
| 658 | if count != N { |
| 659 | t.Fatalf("handler processed %d items, want %d", count, N) |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | // --------------------------------------------------------------------------- |
| 664 | // Full shutdown sequence (integration-level) |
nothing calls this directly
no test coverage detected