mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #103598 from tkashem/integration-test-timeout
integration test: provide a timeout for /health
This commit is contained in:
commit
e0a22acaa0
@ -233,7 +233,10 @@ func startAPIServerOrDie(controlPlaneConfig *controlplane.Config, incomingServer
|
|||||||
}
|
}
|
||||||
var lastHealthContent []byte
|
var lastHealthContent []byte
|
||||||
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
|
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
|
status := 0
|
||||||
result.StatusCode(&status)
|
result.StatusCode(&status)
|
||||||
if status == 200 {
|
if status == 200 {
|
||||||
|
Loading…
Reference in New Issue
Block a user