Merge pull request #103598 from tkashem/integration-test-timeout

integration test: provide a timeout for /health
This commit is contained in:
Kubernetes Prow Robot 2021-07-12 06:06:47 -07:00 committed by GitHub
commit e0a22acaa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {