MCPcopy
hub / github.com/panjf2000/ants / TestPoolPanicWithoutHandler

Function TestPoolPanicWithoutHandler

ants_test.go:398–415  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

396}
397
398func TestPoolPanicWithoutHandler(t *testing.T) {
399 p0, err := ants.NewPool(10)
400 require.NoErrorf(t, err, "create new pool failed: %v", err)
401 defer p0.Release()
402 _ = p0.Submit(func() {
403 panic("Oops!")
404 })
405
406 p1, err := ants.NewPoolWithFunc(10, func(p any) { panic(p) })
407 require.NoErrorf(t, err, "create new pool with func failed: %v", err)
408 defer p1.Release()
409 _ = p1.Invoke("Oops!")
410
411 p2, err := ants.NewPoolWithFuncGeneric(10, func(p string) { panic(p) })
412 require.NoErrorf(t, err, "create new pool with func failed: %v", err)
413 defer p2.Release()
414 _ = p2.Invoke("Oops!")
415}
416
417func TestPoolPanicWithoutHandlerPreMalloc(t *testing.T) {
418 p0, err := ants.NewPool(10, ants.WithPreAlloc(true))

Callers

nothing calls this directly

Calls 3

SubmitMethod · 0.95
InvokeMethod · 0.95
ReleaseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…