From 581b088f760611ee4127fcf0d553e4871cc26077 Mon Sep 17 00:00:00 2001 From: Abu Kashem Date: Thu, 8 Jul 2021 18:49:32 -0400 Subject: [PATCH] integration test: provide a timeout for /health --- test/integration/framework/controlplane_utils.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/framework/controlplane_utils.go b/test/integration/framework/controlplane_utils.go index 1faf1fcda65..85284393b27 100644 --- a/test/integration/framework/controlplane_utils.go +++ b/test/integration/framework/controlplane_utils.go @@ -233,7 +233,10 @@ func startAPIServerOrDie(controlPlaneConfig *controlplane.Config, incomingServer } var lastHealthContent []byte err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) { - result := privilegedClient.Get().AbsPath("/healthz").Do(context.TODO()) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + result := privilegedClient.Get().AbsPath("/healthz").Do(ctx) status := 0 result.StatusCode(&status) if status == 200 {