(t *testing.T)
| 518 | } |
| 519 | |
| 520 | func TestPutToOutput_OutwgBalance(t *testing.T) { |
| 521 | ctx, cancel := context.WithCancel(context.Background()) |
| 522 | pool := newTestBasePool(ctx, cancel) |
| 523 | |
| 524 | // fill OutputCh so next send will block |
| 525 | for i := 0; i < cap(pool.OutputCh); i++ { |
| 526 | pool.OutputCh <- newTestBaseline() |
| 527 | pool.Outwg.Add(1) // manual balance for the fills |
| 528 | } |
| 529 | |
| 530 | mustFinish(t, 2*time.Second, "putToOutput on full ch not unblocked by cancel", func() { |
| 531 | go func() { |
| 532 | time.Sleep(50 * time.Millisecond) |
| 533 | cancel() |
| 534 | }() |
| 535 | pool.putToOutput(newTestBaseline()) |
| 536 | }) |
| 537 | |
| 538 | // drain and done for fills |
| 539 | for i := 0; i < cap(pool.OutputCh); i++ { |
| 540 | <-pool.OutputCh |
| 541 | pool.Outwg.Done() |
| 542 | } |
| 543 | pool.Outwg.Wait() |
| 544 | } |
| 545 | |
| 546 | // --------------------------------------------------------------------------- |
| 547 | // putToFuzzy |
nothing calls this directly
no test coverage detected