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

Function TestNoResults

tempodb/pool/pool_test.go:48–70  ·  tempodb/pool/pool_test.go::TestNoResults
(t *testing.T)

Source from the content-addressed store, hash-verified

46}
47
48func TestNoResults(t *testing.T) {
49 prePoolOpts := goleak.IgnoreCurrent()
50
51 p := NewPool(&Config{
52 MaxWorkers: 10,
53 QueueDepth: 10,
54 })
55 opts := goleak.IgnoreCurrent()
56
57 fn := func(_ context.Context, _ interface{}) (interface{}, error) {
58 return nil, nil
59 }
60 payloads := []interface{}{1, 2, 3, 4, 5}
61
62 msg, funcErrs, err := p.RunJobs(context.Background(), payloads, fn)
63 assert.Nil(t, msg)
64 assert.Nil(t, err)
65 assert.Nil(t, funcErrs)
66 goleak.VerifyNone(t, opts)
67
68 p.Shutdown()
69 goleak.VerifyNone(t, prePoolOpts)
70}
71
72func TestMultipleHits(t *testing.T) {
73 prePoolOpts := goleak.IgnoreCurrent()

Callers

nothing calls this directly

Calls 3

RunJobsMethod · 0.95
ShutdownMethod · 0.95
NewPoolFunction · 0.70

Tested by

no test coverage detected