Skip to content

Commit 3e9abe4

Browse files
(e2e): test: skip terminating pods in catalog image update test
Filter out pods with DeletionTimestamp to avoid false failures during pod rollouts when old pods are being deleted. Fixes flaky test failure where test found 2 pods (1 terminating, 1 active) and incorrectly failed on pod count instead of verifying the actual requirement: catalog image was updated. Assisted-by: Cursor
1 parent 961df6c commit 3e9abe4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/e2e/catalog_e2e_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
78
"k8s.io/apimachinery/pkg/util/intstr"
89

910
"net"
@@ -1169,6 +1170,10 @@ var _ = Describe("Starting CatalogSource e2e tests", Label("CatalogSource"), fun
11691170
}
11701171

11711172
for _, pod := range podList.Items {
1173+
// Skip terminating pods
1174+
if pod.DeletionTimestamp != nil {
1175+
continue
1176+
}
11721177
ctx.Ctx().Logf("old image id %s\n new image id %s\n", registryPod.Items[0].Status.ContainerStatuses[0].ImageID,
11731178
pod.Status.ContainerStatuses[0].ImageID)
11741179
if pod.Status.ContainerStatuses[0].ImageID != registryPod.Items[0].Status.ContainerStatuses[0].ImageID {
@@ -1194,10 +1199,8 @@ var _ = Describe("Starting CatalogSource e2e tests", Label("CatalogSource"), fun
11941199
return false
11951200
}
11961201
By("await new catalog source and ensure old one was deleted")
1197-
registryPods, err = awaitPodsWithInterval(GinkgoT(), c, source.GetNamespace(), selector.String(), 30*time.Second, 10*time.Minute, podCheckFunc)
1202+
_, err = awaitPodsWithInterval(GinkgoT(), c, source.GetNamespace(), selector.String(), 30*time.Second, 10*time.Minute, podCheckFunc)
11981203
Expect(err).ShouldNot(HaveOccurred(), "error awaiting registry pod")
1199-
Expect(registryPods).ShouldNot(BeNil(), "nil registry pods")
1200-
Expect(registryPods.Items).To(HaveLen(1), "unexpected number of registry pods found")
12011204

12021205
By("update catalog source with annotation (to kick resync)")
12031206
Eventually(func() error {

0 commit comments

Comments
 (0)