MCPcopy
hub / github.com/grafana/tempo / TestTooManyJobs

Function TestTooManyJobs

tempodb/pool/pool_test.go:160–182  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

158}
159
160func TestTooManyJobs(t *testing.T) {
161 prePoolOpts := goleak.IgnoreCurrent()
162
163 p := NewPool(&Config{
164 MaxWorkers: 10,
165 QueueDepth: 3,
166 })
167 opts := goleak.IgnoreCurrent()
168
169 fn := func(_ context.Context, _ interface{}) (interface{}, error) {
170 return nil, nil
171 }
172 payloads := []interface{}{1, 2, 3, 4, 5}
173
174 msg, funcErrs, err := p.RunJobs(context.Background(), payloads, fn)
175 assert.Nil(t, msg)
176 assert.Nil(t, funcErrs)
177 assert.Error(t, err)
178 goleak.VerifyNone(t, opts)
179
180 p.Shutdown()
181 goleak.VerifyNone(t, prePoolOpts)
182}
183
184func TestOneWorker(t *testing.T) {
185 prePoolOpts := goleak.IgnoreCurrent()

Callers

nothing calls this directly

Calls 4

RunJobsMethod · 0.95
ShutdownMethod · 0.95
NewPoolFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…