diff --git a/tests/e2e/gatewaycontroller/gateway_controller_test.go b/tests/e2e/gatewaycontroller/gateway_controller_test.go index dd4ddfc2d4..51d230e737 100644 --- a/tests/e2e/gatewaycontroller/gateway_controller_test.go +++ b/tests/e2e/gatewaycontroller/gateway_controller_test.go @@ -35,6 +35,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" "istio.io/istio/pkg/ptr" @@ -215,10 +216,20 @@ spec: }) It("curl client pod is ready", func(ctx SpecContext) { - Eventually(func() error { - return common.CheckPodsReady(ctx, cl, gatewayNamespace) + // Check only the curl-client pod + Eventually(func(g Gomega) { + pod := &corev1.Pod{} + g.Expect(cl.Get(ctx, kube.Key("curl-client", gatewayNamespace), pod)).To(Succeed()) + var ready bool + for _, cond := range pod.Status.Conditions { + if cond.Type == corev1.PodReady && cond.Status == corev1.ConditionTrue { + ready = true + break + } + } + g.Expect(ready).To(BeTrue(), "curl-client pod is not ready") }).Should(Succeed()) - Success("All pods in gateway namespace are ready") + Success("Curl client pod is ready") }) }) diff --git a/tests/e2e/library/library_reconcile_test.go b/tests/e2e/library/library_reconcile_test.go index 4000675550..a0d47d9221 100644 --- a/tests/e2e/library/library_reconcile_test.go +++ b/tests/e2e/library/library_reconcile_test.go @@ -275,12 +275,15 @@ var _ = Describe("Library Reconciliation", Label("library", "reconciliation"), O webhookKey := types.NamespacedName{ Name: fmt.Sprintf("istio-validator-%s-%s", revision, namespace), } - webhook := &admissionv1.ValidatingWebhookConfiguration{} - Expect(cl.Get(ctx, webhookKey, webhook)).To(Succeed()) - webhook.Webhooks[0].Name = "xyz.xyz.xyz" - webhook.Webhooks[0].FailurePolicy = ptr.Of(admissionv1.Fail) - Expect(cl.Update(ctx, webhook)).To(Succeed()) + // The background reconciler may update the webhook concurrently; retry on conflict. + Eventually(func(g Gomega) { + webhook := &admissionv1.ValidatingWebhookConfiguration{} + g.Expect(cl.Get(ctx, webhookKey, webhook)).To(Succeed()) + webhook.Webhooks[0].Name = "xyz.xyz.xyz" + webhook.Webhooks[0].FailurePolicy = ptr.Of(admissionv1.Fail) + g.Expect(cl.Update(ctx, webhook)).To(Succeed()) + }).Should(Succeed()) Eventually(func(g Gomega) { restored := &admissionv1.ValidatingWebhookConfiguration{}