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

Function TestDataEncodings

tempodb/pool/pool_test.go:317–344  ·  tempodb/pool/pool_test.go::TestDataEncodings
(t *testing.T)

Source from the content-addressed store, hash-verified

315}
316
317func TestDataEncodings(t *testing.T) {
318 prePoolOpts := goleak.IgnoreCurrent()
319
320 p := NewPool(&Config{
321 MaxWorkers: 10,
322 QueueDepth: 10,
323 })
324 opts := goleak.IgnoreCurrent()
325
326 ret := []byte{0x01, 0x02}
327 fn := func(_ context.Context, _ interface{}) (interface{}, error) {
328 return ret, nil
329 }
330 payloads := []interface{}{1, 2, 3, 4, 5}
331
332 msg, funcErrs, err := p.RunJobs(context.Background(), payloads, fn)
333 require.Len(t, msg, 5)
334 for i := range payloads {
335 assert.Equal(t, ret, msg[i])
336 }
337
338 assert.Nil(t, err)
339 assert.Nil(t, funcErrs)
340 goleak.VerifyNone(t, opts)
341
342 p.Shutdown()
343 goleak.VerifyNone(t, prePoolOpts)
344}
345
346func TestCancellation(t *testing.T) {
347 prePoolOpts := goleak.IgnoreCurrent()

Callers

nothing calls this directly

Calls 5

RunJobsMethod · 0.95
ShutdownMethod · 0.95
NewPoolFunction · 0.70
LenMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected