MCPcopy Index your code
hub / github.com/deepflowio/deepflow / TestMultiQueue

Function TestMultiQueue

server/libs/queue/multi_queue_test.go:24–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22)
23
24func TestMultiQueue(t *testing.T) {
25 queue := NewOverwriteQueues("whatever", 15, 1)
26 wg := sync.WaitGroup{}
27 wg.Add(1)
28 go func() {
29 if item := queue.Get(7); item != 10086 {
30 t.Errorf("Expected 10086, actually %d", item)
31 }
32 wg.Done()
33 }()
34 queue.Put(7, 10086)
35 wg.Wait()
36 if len(queue) != 16 {
37 t.Errorf("Expected 16, actually %d", len(queue))
38 }
39}

Callers

nothing calls this directly

Calls 5

NewOverwriteQueuesFunction · 0.85
GetMethod · 0.65
PutMethod · 0.65
AddMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected