Repository: kubernetes-sigs/kueue

Issue:
[Flake E2E Test] Pod groups when Single CQ should admit group that fits
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!

If the matter is security related, please disclose it privately via https://kubernetes.io/security/
-->


**What happened**:

End To End Suite: kindest/node:v1.34.0: [It] Pod groups when Single CQ should admit group that fits 

```
{Timed out after 10.001s.
The function passed to Eventually failed at /home/prow/go/src/sigs.k8s.io/kueue/test/e2e/singlecluster/pod_test.go:103 with:
Expected
    <[]v1.PodSchedulingGate | len:2, cap:2>: [
        {
            Name: "kueue.x-k8s.io/admission",
        },
        {
            Name: "kueue.x-k8s.io/topology",
        },
    ]
to be empty failed [FAILED] Timed out after 10.001s.
The function passed to Eventually failed at /home/prow/go/src/sigs.k8s.io/kueue/test/e2e/singlecluster/pod_test.go:103 with:
Expected
    <[]v1.PodSchedulingGate | len:2, cap:2>: [
        {
            Name: "kueue.x-k8s.io/admission",
        },
        {
            Name: "kueue.x-k8s.io/topology",
        },
    ]
to be empty
In [It] at: /home/prow/go/src/sigs.k8s.io/kueue/test/e2e/singlecluster/pod_test.go:108 @ 11/26/25 10:02:25.853
}
```

**What you expected to happen**:
No errors

**How to reproduce it (as minimally and precisely as possible)**:
https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/7900/pull-kueue-test-e2e-main-1-34/1993616322499448832

**Anything else we need to know?**:

/kind flake

**Environment**:
- Kubernetes version (use `kubectl version`):
- Kueue version (use `git describe --tags --dirty --always`):
- Cloud provider or hardware configuration:
- OS (e.g: `cat /etc/os-release`):
- Kernel (e.g. `uname -a`):
- Install tools:
- Others:

Hints from issue comments:
@sohankunkerkar: /assign @sohankunkerkar 

Solution patch:
diff --git a/.github/workflows/update-versions-with-renovate.yaml b/.github/workflows/update-versions-with-renovate.yaml
index 966de6f73..84dd88333 100644
--- a/.github/workflows/update-versions-with-renovate.yaml
+++ b/.github/workflows/update-versions-with-renovate.yaml
@@ -1,10 +1,14 @@
-name: update-versions-with-renovate
+name: Update versions with renovate
 
 on:
   schedule:
     # Once a week
     - cron: '0 0 * * 0'
   workflow_dispatch:
+# TODO: remove once permission issue is resolved
+  pull_request:
+    branches:
+      - main
 
 jobs:
   renovate:
@@ -13,14 +17,15 @@ jobs:
     permissions:
       contents: write
       pull-requests: write
+      issues: write
     steps:
       - name: checkout
         uses: actions/checkout@v6
-      - name: run renovate (dry-run on PRs)
+      - name: run renovate
         uses: renovatebot/github-action@v44.0.4
         with:
           token: ${{ secrets.GITHUB_TOKEN }}
           configurationFile: renovate.json
         env:
-          LOG_LEVEL: info
+          LOG_LEVEL: debug
           RENOVATE_REPOSITORIES: ${{ github.repository }}



Test patch:
diff --git a/test/e2e/singlecluster/e2e_test.go b/test/e2e/singlecluster/e2e_test.go
index b30f76cb3..fe0dcb701 100644
--- a/test/e2e/singlecluster/e2e_test.go
+++ b/test/e2e/singlecluster/e2e_test.go
@@ -193,12 +193,8 @@ var _ = ginkgo.Describe("Kueue", func() {
 				})
 			})
 			ginkgo.By("verify the workload was created and admitted for the Job", func() {
-				createdWorkload := &kueue.Workload{}
 				wlLookupKey := types.NamespacedName{Name: workloadjob.GetWorkloadNameForJob(createdJob.Name, createdJob.UID), Namespace: ns.Name}
-				gomega.Eventually(func(g gomega.Gomega) {
-					g.Expect(k8sClient.Get(ctx, wlLookupKey, createdWorkload)).Should(gomega.Succeed())
-					g.Expect(workload.HasQuotaReservation(createdWorkload)).Should(gomega.BeTrue())
-				}, util.LongTimeout, util.Interval).Should(gomega.Succeed())
+				util.ExpectWorkloadsToHaveQuotaReservationByKey(ctx, k8sClient, clusterQueue.Name, wlLookupKey)
 			})
 		})
 
@@ -714,10 +710,7 @@ var _ = ginkgo.Describe("Kueue", func() {
 			})
 
 			ginkgo.By("waiting for the workload to be assigned", func() {
-				gomega.Eventually(func(g gomega.Gomega) {
-					g.Expect(k8sClient.Get(ctx, wlLookupKey, createdWorkload)).Should(gomega.Succeed())
-					g.Expect(createdWorkload.Status.Conditions).Should(utiltesting.HaveConditionStatusTrue(kueue.WorkloadQuotaReserved))
-				}, util.Timeout, util.Interval).Should(gomega.Succeed())
+				util.ExpectWorkloadsToHaveQuotaReservationByKey(ctx, k8sClient, clusterQueue.Name, wlLookupKey)
 			})
 
 			ginkgo.By("checking the job remains suspended", func() {
diff --git a/test/e2e/singlecluster/metrics_test.go b/test/e2e/singlecluster/metrics_test.go
index 0593fcc01..2cddbfd90 100644
--- a/test/e2e/singlecluster/metrics_test.go
+++ b/test/e2e/singlecluster/metrics_test.go
@@ -272,23 +272,16 @@ var _ = ginkgo.Describe("Metrics", func() {
 				Namespace: ns.Name,
 			}
 
-			createdWorkload = &kueue.Workload{}
-
-			gomega.Eventually(func(g gomega.Gomega) {
-				g.Expect(k8sClient.Get(ctx, workloadKey, createdWorkload)).Should(gomega.Succeed())
-				g.Expect(createdWorkload.Status.Conditions).Should(utiltesting.HaveConditionStatusTrue(kueue.WorkloadQuotaReserved))
-			}, util.Timeout, util.Interval).Should(gomega.Succeed())
+			util.ExpectWorkloadsToHaveQuotaReservationByKey(ctx, k8sClient, clusterQueue.Name, workloadKey)
 		})
 
 		ginkgo.AfterEach(func() {
-			util.ExpectObjectToBeDeleted(ctx, k8sClient, createdJob, true)
-			util.ExpectObjectToBeDeleted(ctx, k8sClient, createdWorkload, true)
-			util.ExpectObjectToBeDeleted(ctx, k8sClient, localQueue, true)
 			util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
 			util.ExpectObjectToBeDeleted(ctx, k8sClient, admissionCheck, true)
 		})
 
 		ginkgo.It("should ensure the admission check metrics are available", func() {
+			createdWorkload = &kueue.Workload{}
 			ginkgo.By("setting the check as successful", func() {
 				gomega.Eventually(func(g gomega.Gomega) {
 					g.Expect(k8sClient.Get(ctx, workloadKey, createdWorkload)).Should(gomega.Succeed())
diff --git a/test/e2e/singlecluster/pod_test.go b/test/e2e/singlecluster/pod_test.go
index c7c7d2145..231f1f03a 100644
--- a/test/e2e/singlecluster/pod_test.go
+++ b/test/e2e/singlecluster/pod_test.go
@@ -94,6 +94,9 @@ var _ = ginkgo.Describe("Pod groups", func() {
 					To(gomega.ContainElement(corev1.PodSchedulingGate{
 						Name: podconstants.SchedulingGateName}))
 			}
+			ginkgo.By("Verify that the Workload is admitted", func() {
+				util.ExpectWorkloadsToHaveQuotaReservationByKey(ctx, k8sClient, cq.Name, gKey)
+			})
 			ginkgo.By("Starting admission", func() {
 				// Verify that the Pods start with the appropriate selector.
 				gomega.Eventually(func(g gomega.Gomega) {
diff --git a/test/util/e2e.go b/test/util/e2e.go
index bd0f60718..d78ccf0a9 100644
--- a/test/util/e2e.go
+++ b/test/util/e2e.go
@@ -369,6 +369,18 @@ func RestartKueueController(ctx context.Context, k8sClient client.Client, kindCl
 	kcmKey := types.NamespacedName{Namespace: kueueNS, Name: "kueue-controller-manager"}
 	rolloutOperatorDeployment(ctx, k8sClient, kcmKey, kindClusterName)
 	WaitForKueueAvailabilityNoRestartCountCheck(ctx, k8sClient)
+	waitForDeploymentWithOnlyAvailableReplicas(ctx, k8sClient, kcmKey)
+}
+
+func waitForDeploymentWithOnlyAvailableReplicas(ctx context.Context, k8sClient client.Client, key types.NamespacedName) {
+	deployment := &appsv1.Deployment{}
+	waitForAvailableStart := time.Now()
+	ginkgo.By(fmt.Sprintf("Waiting for deployment to have only available replicas: %q", key))
+	gomega.EventuallyWithOffset(2, func(g gomega.Gomega) {
+		g.Expect(k8sClient.Get(ctx, key, deployment)).To(gomega.Succeed())
+		g.Expect(deployment.Status.Replicas).To(gomega.Equal(deployment.Status.AvailableReplicas))
+	}, LongTimeout, Interval).Should(gomega.Succeed())
+	ginkgo.GinkgoLogr.Info("Deployment has only available replicas in the cluster", "deployment", key, "waitingTime", time.Since(waitForAvailableStart))
 }
 
 func WaitForActivePodsAndTerminate(ctx context.Context, k8sClient client.Client, restClient *rest.RESTClient, cfg *rest.Config, namespace string, activePodsCount, exitCode int, opts ...client.ListOption) {