e2e: add PollInterval()
Various different tests all have their own poll intervals. As a start towards consolidating that, the interval from test/e2e/framework/pod (as one of the most common cases for polling) is moved into the framework. Changing other helper packages and tests needs to follow.
This commit is contained in:
@@ -19,6 +19,7 @@ package framework
|
||||
import "time"
|
||||
|
||||
var defaultTimeouts = TimeoutContext{
|
||||
Poll: 2 * time.Second, // from the former e2e/framework/pod poll interval
|
||||
PodStart: 5 * time.Minute,
|
||||
PodStartShort: 2 * time.Minute,
|
||||
PodStartSlow: 15 * time.Minute,
|
||||
@@ -42,6 +43,9 @@ var defaultTimeouts = TimeoutContext{
|
||||
|
||||
// TimeoutContext contains timeout settings for several actions.
|
||||
type TimeoutContext struct {
|
||||
// Poll is how long to wait between API calls when waiting for some condition.
|
||||
Poll time.Duration
|
||||
|
||||
// PodStart is how long to wait for the pod to be started.
|
||||
PodStart time.Duration
|
||||
|
||||
@@ -111,3 +115,9 @@ func NewTimeoutContext() *TimeoutContext {
|
||||
copy := TestContext.timeouts
|
||||
return ©
|
||||
}
|
||||
|
||||
// PollInterval defines how long to wait between API server queries while
|
||||
// waiting for some condition.
|
||||
func PollInterval() time.Duration {
|
||||
return TestContext.timeouts.Poll
|
||||
}
|
||||
|
Reference in New Issue
Block a user