MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / TestPoolAcquireReturnsWorker

Function TestPoolAcquireReturnsWorker

pkg/util/va/ws_test.go:201–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

199}
200
201func TestPoolAcquireReturnsWorker(t *testing.T) {
202 p, err := newPool(2)
203 if err != nil {
204 t.Fatalf("newPool failed: %v", err)
205 }
206 defer p.close()
207
208 w := p.acquire(50 * time.Millisecond)
209 if w == nil {
210 t.Fatal("acquire returned nil but pool has free workers")
211 }
212}
213
214func TestPoolAcquireReturnsNilWhenExhausted(t *testing.T) {
215 p, err := newPool(2)

Callers

nothing calls this directly

Calls 3

newPoolFunction · 0.85
acquireMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected