From a78cc47b1c0b1dda677c9e059ec063c1c874a126 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Thu, 29 Oct 2020 17:23:10 +0100 Subject: [PATCH] =?UTF-8?q?Use=20HttpgetWithRetry()=20that=E2=80=99ll=20se?= =?UTF-8?q?t=20timeout=20for=20each=20retry=20and=20not=20freeze=20on=20he?= =?UTF-8?q?=20first=20call?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guillaume Tardif --- tests/aci-e2e/e2e-aci_test.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/aci-e2e/e2e-aci_test.go b/tests/aci-e2e/e2e-aci_test.go index 9e77e257..759afb19 100644 --- a/tests/aci-e2e/e2e-aci_test.go +++ b/tests/aci-e2e/e2e-aci_test.go @@ -434,14 +434,7 @@ func TestContainerRunAttached(t *testing.T) { endpoint = fmt.Sprintf("http://%s:%d", fqdn, port.HostPort) assert.Assert(t, !strings.Contains(followLogsProcess.Stdout(), "/test")) - checkRequest := func(t poll.LogT) poll.Result { - r, _ := http.Get(endpoint + "/test") - if r != nil && r.StatusCode == http.StatusNotFound { - return poll.Success() - } - return poll.Continue("waiting for container to serve request") - } - poll.WaitOn(t, checkRequest, poll.WithDelay(1*time.Second), poll.WithTimeout(60*time.Second)) + HTTPGetWithRetry(t, endpoint+"/test", http.StatusNotFound, 2*time.Second, 60*time.Second) checkLog := func(t poll.LogT) poll.Result { if strings.Contains(followLogsProcess.Stdout(), "/test") {