chore: Use standardized test timeouts and delays (#3291)

This commit is contained in:
Mathias Fredriksson
2022-08-01 15:45:05 +03:00
committed by GitHub
parent 3d0febdd90
commit 4730c589fe
25 changed files with 198 additions and 109 deletions

View File

@ -0,0 +1,23 @@
package testutil
import "time"
// Constants for timing out operations, usable for creating contexts
// that timeout or in require.Eventually.
//
// Windows durations are adjusted for slow CI workers.
const (
WaitShort = 10 * time.Second
WaitMedium = 20 * time.Second
WaitLong = 30 * time.Second
)
// Constants for delaying repeated operations, e.g. in
// require.Eventually.
//
// Windows durations are adjusted for slow CI workers.
const (
IntervalFast = 50 * time.Millisecond
IntervalMedium = 500 * time.Millisecond
IntervalSlow = 2 * time.Second
)