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

Function TestNewDisableableTicker_Enabled

pkg/util/time_test.go:114–126  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestNewDisableableTicker_Enabled(t *testing.T) {
115 stop, ch := NewDisableableTicker(10 * time.Millisecond)
116 defer stop()
117
118 time.Sleep(100 * time.Millisecond)
119
120 select {
121 case <-ch:
122 break
123 default:
124 t.Error("ticker should have ticked when enabled")
125 }
126}
127
128func TestNewDisableableTicker_Disabled(t *testing.T) {
129 stop, ch := NewDisableableTicker(0)

Callers

nothing calls this directly

Calls 2

NewDisableableTickerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected