MCPcopy Index your code
hub / github.com/cortexproject/cortex / TestStopAndDrainTimer_UnfiredTimer

Function TestStopAndDrainTimer_UnfiredTimer

pkg/util/timer/timer_test.go:13–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11}
12
13func TestStopAndDrainTimer_UnfiredTimer(t *testing.T) {
14 timer := time.NewTimer(time.Hour)
15 StopAndDrainTimer(timer)
16
17 // Channel should be empty after stop+drain.
18 select {
19 case <-timer.C:
20 t.Fatal("expected timer channel to be drained")
21 default:
22 }
23}
24
25func TestStopAndDrainTimer_FiredTimer(t *testing.T) {
26 timer := time.NewTimer(time.Nanosecond)

Callers

nothing calls this directly

Calls 1

StopAndDrainTimerFunction · 0.85

Tested by

no test coverage detected