mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Use standardized test timeouts and delays (#3291)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
//go:build !windows
|
||||
|
||||
package testutil
|
||||
|
||||
import "time"
|
||||
|
||||
// Constants for timing out operations, usable for creating contexts
|
||||
// that timeout or in require.Eventually.
|
||||
const (
|
||||
WaitShort = 5 * time.Second
|
||||
WaitMedium = 10 * time.Second
|
||||
WaitLong = 15 * time.Second
|
||||
)
|
||||
|
||||
// Constants for delaying repeated operations, e.g. in
|
||||
// require.Eventually.
|
||||
const (
|
||||
IntervalFast = 25 * time.Millisecond
|
||||
IntervalMedium = 250 * time.Millisecond
|
||||
IntervalSlow = time.Second
|
||||
)
|
||||
@@ -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
|
||||
)
|
||||
Reference in New Issue
Block a user