aboutsummaryrefslogtreecommitdiff
path: root/test/e2e/common_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/common_test.go')
-rw-r--r--test/e2e/common_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index e882b6be3..fc7a18afb 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -1064,13 +1064,13 @@ func digShort(container, lookupName string, matchNames []string, p *PodmanTestIn
// WaitForFile to be created in defaultWaitTimeout seconds, returns false if file not created
func WaitForFile(path string) (err error) {
until := time.Now().Add(time.Duration(defaultWaitTimeout) * time.Second)
- for i := 1; time.Now().Before(until); i++ {
+ for time.Now().Before(until) {
_, err = os.Stat(path)
switch {
case err == nil:
return nil
case errors.Is(err, os.ErrNotExist):
- time.Sleep(time.Duration(i) * time.Second)
+ time.Sleep(10 * time.Millisecond)
default:
return err
}
@@ -1078,11 +1078,12 @@ func WaitForFile(path string) (err error) {
return err
}
-// WaitForService blocks, waiting for some service listening on given host:port
+// WaitForService blocks for defaultWaitTimeout seconds, waiting for some service listening on given host:port
func WaitForService(address url.URL) {
// Wait for podman to be ready
var err error
- for i := 1; i <= 5; i++ {
+ until := time.Now().Add(time.Duration(defaultWaitTimeout) * time.Second)
+ for time.Now().Before(until) {
var conn net.Conn
conn, err = net.Dial("tcp", address.Host)
if err == nil {
@@ -1091,7 +1092,7 @@ func WaitForService(address url.URL) {
}
// Podman not available yet...
- time.Sleep(time.Duration(i) * time.Second)
+ time.Sleep(10 * time.Millisecond)
}
Expect(err).ShouldNot(HaveOccurred())
}