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

Function TestNewPoolCreatesCorrectNumberOfWorkers

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

Source from the content-addressed store, hash-verified

183}
184
185func TestNewPoolCreatesCorrectNumberOfWorkers(t *testing.T) {
186 size := 3
187 p, err := newPool(size)
188 if err != nil {
189 t.Fatalf("newPool failed: %v", err)
190 }
191 defer p.close()
192
193 if len(p.workers) != size {
194 t.Errorf("worker count = %d, want %d", len(p.workers), size)
195 }
196 if cap(p.free) != size {
197 t.Errorf("free channel capacity = %d, want %d", cap(p.free), size)
198 }
199}
200
201func TestPoolAcquireReturnsWorker(t *testing.T) {
202 p, err := newPool(2)

Callers

nothing calls this directly

Calls 2

newPoolFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected