From daae472fe1b23544966d53a390134157822e8537 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Wed, 4 Jun 2025 13:27:46 -0400 Subject: [PATCH] e2e_node: verify restart looping container correctly when a test is verifying a container has restarted, we use a continually exiting container. Not verifying the number of restarts is less than (rather than equal) introduces a race between the container restarting and the status observation. Signed-off-by: Peter Hunt --- test/e2e_node/garbage_collector_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e_node/garbage_collector_test.go b/test/e2e_node/garbage_collector_test.go index 5e6bb473717..5a11a109e22 100644 --- a/test/e2e_node/garbage_collector_test.go +++ b/test/e2e_node/garbage_collector_test.go @@ -328,7 +328,7 @@ func verifyPodRestartCount(ctx context.Context, f *framework.Framework, podName updatedPod.Name, expectedNumContainers, len(updatedPod.Status.ContainerStatuses)) } for _, containerStatus := range updatedPod.Status.ContainerStatuses { - if containerStatus.RestartCount != expectedRestartCount { + if containerStatus.RestartCount < expectedRestartCount { return fmt.Errorf("pod %s had container with restartcount %d. Should have been at least %d", updatedPod.Name, containerStatus.RestartCount, expectedRestartCount) }