(t *testing.T)
| 500 | } |
| 501 | |
| 502 | func TestPutToOutput_AfterCancel(t *testing.T) { |
| 503 | ctx, cancel := context.WithCancel(context.Background()) |
| 504 | pool := newTestBasePool(ctx, cancel) |
| 505 | cancel() |
| 506 | |
| 507 | mustFinish(t, 2*time.Second, "putToOutput blocked after cancel", func() { |
| 508 | pool.putToOutput(newTestBaseline()) |
| 509 | }) |
| 510 | // select may have picked OutputCh (buffer available) or ctx.Done(); |
| 511 | // drain if sent so Outwg stays balanced. |
| 512 | select { |
| 513 | case <-pool.OutputCh: |
| 514 | pool.Outwg.Done() |
| 515 | default: |
| 516 | } |
| 517 | pool.Outwg.Wait() |
| 518 | } |
| 519 | |
| 520 | func TestPutToOutput_OutwgBalance(t *testing.T) { |
| 521 | ctx, cancel := context.WithCancel(context.Background()) |
nothing calls this directly
no test coverage detected