From e2b1050516288e10f342dd66591cccd81340ee9a Mon Sep 17 00:00:00 2001 From: Paco Xu Date: Thu, 2 Mar 2023 17:01:38 +0800 Subject: [PATCH] add some buff for pod initial restart count that is not zero --- test/e2e/common/node/container_probe.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/e2e/common/node/container_probe.go b/test/e2e/common/node/container_probe.go index 36e1c2e4078..a935b610fe1 100644 --- a/test/e2e/common/node/container_probe.go +++ b/test/e2e/common/node/container_probe.go @@ -970,7 +970,9 @@ func RunLivenessTest(ctx context.Context, f *framework.Framework, pod *v1.Pod, e framework.Logf("Initial restart count of pod %s is %d", pod.Name, initialRestartCount) // Wait for the restart state to be as desired. - deadline := time.Now().Add(timeout) + // If initialRestartCount is not zero, there is restarting back-off time. + deadline := time.Now().Add(timeout + time.Duration(initialRestartCount)*10*time.Second) + lastRestartCount := initialRestartCount observedRestarts := int32(0) for start := time.Now(); time.Now().Before(deadline); time.Sleep(2 * time.Second) {