(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestDurationWithJitter(t *testing.T) { |
| 37 | const numRuns = 1000 |
| 38 | |
| 39 | for range numRuns { |
| 40 | actual := DurationWithJitter(time.Minute, 0.5) |
| 41 | assert.GreaterOrEqual(t, int64(actual), int64(30*time.Second)) |
| 42 | assert.LessOrEqual(t, int64(actual), int64(90*time.Second)) |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | func TestDurationWithJitter_ZeroInputDuration(t *testing.T) { |
| 47 | assert.Equal(t, time.Duration(0), DurationWithJitter(time.Duration(0), 0.5)) |
nothing calls this directly
no test coverage detected