(t *testing.T)
| 332 | } |
| 333 | |
| 334 | func TestAddAddition_FullBufferUnblocksOnCancel(t *testing.T) { |
| 335 | ctx, cancel := context.WithCancel(context.Background()) |
| 336 | pool := newTestBasePool(ctx, cancel) |
| 337 | |
| 338 | // fill buffer |
| 339 | for i := 0; i < cap(pool.additionCh); i++ { |
| 340 | pool.additionCh <- &Unit{path: "/fill"} |
| 341 | } |
| 342 | |
| 343 | mustFinish(t, 2*time.Second, "addAddition on full buffer not unblocked by cancel", func() { |
| 344 | go func() { |
| 345 | time.Sleep(50 * time.Millisecond) |
| 346 | cancel() |
| 347 | }() |
| 348 | pool.addAddition(&Unit{path: "/blocked", source: parsers.WordSource}) |
| 349 | }) |
| 350 | } |
| 351 | |
| 352 | func TestAddAddition_ConcurrentShutdown(t *testing.T) { |
| 353 | ctx, cancel := context.WithCancel(context.Background()) |
nothing calls this directly
no test coverage detected