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

Function TestSendProcess_Normal

core/pool/pool_test.go:385–401  ·  view source on GitHub ↗

--------------------------------------------------------------------------- sendProcess ---------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

383// ---------------------------------------------------------------------------
384
385func TestSendProcess_Normal(t *testing.T) {
386 ctx, cancel := context.WithCancel(context.Background())
387 defer cancel()
388 pool := newTestBasePool(ctx, cancel)
389
390 bl := newTestBaseline()
391 pool.sendProcess(bl)
392
393 select {
394 case got := <-pool.processCh:
395 if got.UrlString != bl.UrlString {
396 t.Fatalf("got %q, want %q", got.UrlString, bl.UrlString)
397 }
398 case <-time.After(time.Second):
399 t.Fatal("sendProcess: channel receive timed out")
400 }
401}
402
403func TestSendProcess_AfterCancel(t *testing.T) {
404 ctx, cancel := context.WithCancel(context.Background())

Callers

nothing calls this directly

Calls 3

newTestBasePoolFunction · 0.85
newTestBaselineFunction · 0.85
sendProcessMethod · 0.80

Tested by

no test coverage detected