(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestDurationWithPositiveJitter(t *testing.T) { |
| 51 | const numRuns = 1000 |
| 52 | |
| 53 | for range numRuns { |
| 54 | actual := DurationWithPositiveJitter(time.Minute, 0.5) |
| 55 | assert.GreaterOrEqual(t, int64(actual), int64(60*time.Second)) |
| 56 | assert.LessOrEqual(t, int64(actual), int64(90*time.Second)) |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | func TestDurationWithPositiveJitter_ZeroInputDuration(t *testing.T) { |
| 61 | assert.Equal(t, time.Duration(0), DurationWithPositiveJitter(time.Duration(0), 0.5)) |
nothing calls this directly
no test coverage detected