浏览代码

Use HttpgetWithRetry() that’ll set timeout for each retry and not freeze on he first call

Signed-off-by: Guillaume Tardif <[email protected]>
Guillaume Tardif 5 年之前
父节点
当前提交
a78cc47b1c
共有 1 个文件被更改,包括 1 次插入8 次删除
  1. 1 8
      tests/aci-e2e/e2e-aci_test.go

+ 1 - 8
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") {