MCPcopy Create free account
hub / github.com/chainreactors/spray / TestSendProcess_FullBufferUnblocksOnCancel

Function TestSendProcess_FullBufferUnblocksOnCancel

core/pool/pool_test.go:413–428  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

411}
412
413func TestSendProcess_FullBufferUnblocksOnCancel(t *testing.T) {
414 ctx, cancel := context.WithCancel(context.Background())
415 pool := newTestBasePool(ctx, cancel)
416
417 for i := 0; i < cap(pool.processCh); i++ {
418 pool.processCh <- newTestBaseline()
419 }
420
421 mustFinish(t, 2*time.Second, "sendProcess on full buffer not unblocked by cancel", func() {
422 go func() {
423 time.Sleep(50 * time.Millisecond)
424 cancel()
425 }()
426 pool.sendProcess(newTestBaseline())
427 })
428}
429
430func TestSendProcess_ConcurrentShutdown(t *testing.T) {
431 ctx, cancel := context.WithCancel(context.Background())

Callers

nothing calls this directly

Calls 4

newTestBasePoolFunction · 0.85
newTestBaselineFunction · 0.85
mustFinishFunction · 0.85
sendProcessMethod · 0.80

Tested by

no test coverage detected