Skip to content

Commit d1dd10f

Browse files
committed
fix tests
1 parent fbfadf6 commit d1dd10f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

test/e2e/parallel/user_workloads_test.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,21 @@ func TestIdlerAndPriorityClass(t *testing.T) {
3838
podsToIdle := prepareWorkloads(t, await.Member1(), idler.Name, wait.WithSandboxPriorityClass())
3939
podsNoise := prepareWorkloads(t, await.Member1(), idlerNoise.Name, wait.WithSandboxPriorityClass())
4040

41+
// Create a Claw workload only in the dev namespace (the one being idled).
42+
// Not added to prepareWorkloads to avoid exceeding the ClusterResourceQuota pod limit
43+
// when workloads are created in multiple namespaces for the same user.
44+
clawDeployment := createClaw(t, memberAwait, "test-idler-claw", idler.Name)
45+
podsToIdle, err := memberAwait.WaitForPods(t, idler.Name, len(podsToIdle)+int(*clawDeployment.Spec.Replicas),
46+
wait.PodRunning(), wait.WithPodLabel("idler", "idler"), wait.WithSandboxPriorityClass())
47+
require.NoError(t, err)
48+
4149
// Create more noise pods in non-user namespace
4250
memberAwait.CreateNamespace(t, "workloads-noise")
4351
externalNsPodsNoise := prepareWorkloads(t, await.Member1(), "workloads-noise", wait.WithOriginalPriorityClass())
4452

4553
// Set a short timeout for one of the idler to trigger pod idling
4654
// The idler is currently updating its status since it's already been idling the pods. So we need to keep trying to update.
47-
idler, err := wait.For(t, memberAwait.Awaitility, &toolchainv1alpha1.Idler{}).
55+
idler, err = wait.For(t, memberAwait.Awaitility, &toolchainv1alpha1.Idler{}).
4856
Update(idler.Name, memberAwait.Namespace, func(i *toolchainv1alpha1.Idler) {
4957
i.Spec.TimeoutSeconds = 5
5058
})
@@ -185,9 +193,6 @@ func prepareWorkloads(t *testing.T, memberAwait *wait.MemberAwaitility, namespac
185193
servingRuntimeDeployment := createKServeWorkloads(t, memberAwait, "test-idler-kserve", namespace)
186194
n = n + int(*servingRuntimeDeployment.Spec.Replicas)
187195

188-
clawDeployment := createClaw(t, memberAwait, "test-idler-claw", namespace)
189-
n = n + int(*clawDeployment.Spec.Replicas)
190-
191196
pods, err := memberAwait.WaitForPods(t, namespace, n, append(additionalPodCriteria, wait.PodRunning(),
192197
wait.WithPodLabel("idler", "idler"))...)
193198
require.NoError(t, err)

0 commit comments

Comments
 (0)