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

Function TestAddAddition_AfterCancel

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

Source from the content-addressed store, hash-verified

212}
213
214func TestAddAddition_AfterCancel(t *testing.T) {
215 ctx, cancel := context.WithCancel(context.Background())
216 pool := newTestBasePool(ctx, cancel)
217 cancel()
218
219 pool.addAddition(&Unit{path: "/a", source: parsers.WordSource})
220
221 select {
222 case <-pool.additionCh:
223 t.Fatal("should not send after cancel")
224 default:
225 }
226 // wg must be zero — the cancelled path must not leak a counter
227 pool.wg.Wait()
228}
229
230func withStatusFilters(t *testing.T) {
231 t.Helper()

Callers

nothing calls this directly

Calls 2

newTestBasePoolFunction · 0.85
addAdditionMethod · 0.80

Tested by

no test coverage detected