From ec5e984ed9cd8aa6d7dcfe094b934f4182dd2d62 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Fri, 12 May 2017 21:45:18 +0200 Subject: [PATCH] Increase waiting time for network services --- src/restic/backend/rest/rest_test.go | 3 ++- src/restic/backend/s3/s3_test.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/restic/backend/rest/rest_test.go b/src/restic/backend/rest/rest_test.go index 4de0ad871..d378a364f 100644 --- a/src/restic/backend/rest/rest_test.go +++ b/src/restic/backend/rest/rest_test.go @@ -32,9 +32,10 @@ func runRESTServer(ctx context.Context, t testing.TB, dir string) func() { // wait until the TCP port is reachable var success bool for i := 0; i < 10; i++ { + time.Sleep(200 * time.Millisecond) + c, err := net.Dial("tcp", "localhost:8000") if err != nil { - time.Sleep(200 * time.Millisecond) continue } diff --git a/src/restic/backend/s3/s3_test.go b/src/restic/backend/s3/s3_test.go index 66511307e..f50bfd680 100644 --- a/src/restic/backend/s3/s3_test.go +++ b/src/restic/backend/s3/s3_test.go @@ -50,9 +50,10 @@ func runMinio(ctx context.Context, t testing.TB, dir, key, secret string) func() // wait until the TCP port is reachable var success bool for i := 0; i < 10; i++ { + time.Sleep(200 * time.Millisecond) + c, err := net.Dial("tcp", "localhost:9000") if err != nil { - time.Sleep(200 * time.Millisecond) continue }