mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
fix: fixes flake in TestKMSv2Healthz
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>
This commit is contained in:
parent
e121039461
commit
9d19c207d2
@ -528,7 +528,7 @@ func (e *transformTest) printMetrics() error {
|
|||||||
func mustBeHealthy(t kubeapiservertesting.Logger, checkName, wantBodyContains string, clientConfig *rest.Config, excludes ...string) {
|
func mustBeHealthy(t kubeapiservertesting.Logger, checkName, wantBodyContains string, clientConfig *rest.Config, excludes ...string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
var restErr error
|
var restErr error
|
||||||
pollErr := wait.PollImmediate(2*time.Second, 2*time.Minute, func() (bool, error) {
|
pollErr := wait.PollImmediate(1*time.Second, 5*time.Minute, func() (bool, error) {
|
||||||
body, ok, err := getHealthz(checkName, clientConfig, excludes...)
|
body, ok, err := getHealthz(checkName, clientConfig, excludes...)
|
||||||
restErr = err
|
restErr = err
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -541,7 +541,7 @@ func mustBeHealthy(t kubeapiservertesting.Logger, checkName, wantBodyContains st
|
|||||||
return done, nil
|
return done, nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if pollErr == wait.ErrWaitTimeout {
|
if pollErr != nil {
|
||||||
t.Fatalf("failed to get the expected healthz status of OK for check: %s, error: %v, debug inner error: %v", checkName, pollErr, restErr)
|
t.Fatalf("failed to get the expected healthz status of OK for check: %s, error: %v, debug inner error: %v", checkName, pollErr, restErr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -549,7 +549,7 @@ func mustBeHealthy(t kubeapiservertesting.Logger, checkName, wantBodyContains st
|
|||||||
func mustBeUnHealthy(t kubeapiservertesting.Logger, checkName, wantBodyContains string, clientConfig *rest.Config, excludes ...string) {
|
func mustBeUnHealthy(t kubeapiservertesting.Logger, checkName, wantBodyContains string, clientConfig *rest.Config, excludes ...string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
var restErr error
|
var restErr error
|
||||||
pollErr := wait.PollImmediate(2*time.Second, 2*time.Minute, func() (bool, error) {
|
pollErr := wait.PollImmediate(1*time.Second, 5*time.Minute, func() (bool, error) {
|
||||||
body, ok, err := getHealthz(checkName, clientConfig, excludes...)
|
body, ok, err := getHealthz(checkName, clientConfig, excludes...)
|
||||||
restErr = err
|
restErr = err
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -562,7 +562,7 @@ func mustBeUnHealthy(t kubeapiservertesting.Logger, checkName, wantBodyContains
|
|||||||
return done, nil
|
return done, nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if pollErr == wait.ErrWaitTimeout {
|
if pollErr != nil {
|
||||||
t.Fatalf("failed to get the expected healthz status of !OK for check: %s, error: %v, debug inner error: %v", checkName, pollErr, restErr)
|
t.Fatalf("failed to get the expected healthz status of !OK for check: %s, error: %v, debug inner error: %v", checkName, pollErr, restErr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user