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

Function TestPutToFuzzy_Normal

core/pool/pool_test.go:550–570  ·  view source on GitHub ↗

--------------------------------------------------------------------------- putToFuzzy ---------------------------------------------------------------------------

(t *testing.T)

Source from the content-addressed store, hash-verified

548// ---------------------------------------------------------------------------
549
550func TestPutToFuzzy_Normal(t *testing.T) {
551 ctx, cancel := context.WithCancel(context.Background())
552 defer cancel()
553 pool := newTestBasePool(ctx, cancel)
554
555 pool.putToFuzzy(newTestBaseline())
556
557 select {
558 case bl := <-pool.FuzzyCh:
559 if !bl.IsFuzzy {
560 t.Fatal("IsFuzzy should be true")
561 }
562 if bl.IsValid {
563 t.Fatal("fuzzy output snapshot should not stay valid")
564 }
565 case <-time.After(time.Second):
566 t.Fatal("putToFuzzy: receive timed out")
567 }
568 pool.Outwg.Done()
569 pool.Outwg.Wait()
570}
571
572func TestPutToFuzzySnapshotsBaseline(t *testing.T) {
573 ctx, cancel := context.WithCancel(context.Background())

Callers

nothing calls this directly

Calls 4

newTestBasePoolFunction · 0.85
newTestBaselineFunction · 0.85
putToFuzzyMethod · 0.80
DoneMethod · 0.45

Tested by

no test coverage detected