MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestPriorityQueueWait

Function TestPriorityQueueWait

pkg/util/priority_queue_test.go:62–78  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestPriorityQueueWait(t *testing.T) {
63 queue := NewPriorityQueue(nil)
64
65 done := make(chan struct{})
66 go func() {
67 assert.Nil(t, queue.Dequeue(), "Expect nil dequeue")
68 close(done)
69 }()
70
71 queue.Close()
72 runtime.Gosched()
73 select {
74 case <-done:
75 case <-time.After(100 * time.Millisecond):
76 t.Fatal("Close didn't unblock Dequeue.")
77 }
78}
79
80func TestPriorityQueueClose(t *testing.T) {
81 queue := NewPriorityQueue(nil)

Callers

nothing calls this directly

Calls 4

DequeueMethod · 0.95
CloseMethod · 0.95
NewPriorityQueueFunction · 0.85
AfterMethod · 0.80

Tested by

no test coverage detected