diff --git a/wait/http.go b/wait/http.go index ba89dca62d..77528f44b3 100644 --- a/wait/http.go +++ b/wait/http.go @@ -46,7 +46,7 @@ func NewHTTPStrategy(path string) *HTTPStrategy { TLSConfig: nil, Method: http.MethodGet, Body: nil, - PollInterval: time.Second / 10, + PollInterval: defaultPollInterval(), } } diff --git a/wait/log.go b/wait/log.go index 1173624423..8aa3050309 100644 --- a/wait/log.go +++ b/wait/log.go @@ -17,8 +17,8 @@ type LogStrategy struct { // additional properties Log string - PollInterval time.Duration Occurrence int + PollInterval time.Duration } // NewLogStrategy constructs a HTTP strategy waiting on port 80 and status code 200 @@ -26,8 +26,8 @@ func NewLogStrategy(log string) *LogStrategy { return &LogStrategy{ startupTimeout: defaultStartupTimeout(), Log: log, - PollInterval: 100 * time.Millisecond, Occurrence: 1, + PollInterval: defaultPollInterval(), } } diff --git a/wait/sql.go b/wait/sql.go index e632ea10d1..aabd754e58 100644 --- a/wait/sql.go +++ b/wait/sql.go @@ -16,7 +16,7 @@ func ForSQL(port nat.Port, driver string, url func(nat.Port) string) *waitForSql URL: url, Driver: driver, startupTimeout: defaultStartupTimeout(), - PollInterval: 100 * time.Millisecond, + PollInterval: defaultPollInterval(), } } diff --git a/wait/wait.go b/wait/wait.go index f71b9e999e..9439edeae6 100644 --- a/wait/wait.go +++ b/wait/wait.go @@ -22,3 +22,7 @@ type StrategyTarget interface { func defaultStartupTimeout() time.Duration { return 60 * time.Second } + +func defaultPollInterval() time.Duration { + return 100 * time.Millisecond +}