From 3ea232f22025758221adde4aac8b017a08eeb8c3 Mon Sep 17 00:00:00 2001 From: Hamza <12420351+0xMH@users.noreply.github.com> Date: Tue, 17 Mar 2026 11:29:37 +0100 Subject: [PATCH] DRA: adapt FilterTimeout test after upstream dra_test.go split --- test/integration/dra/core.go | 5 +++-- test/integration/dra/helpers.go | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/test/integration/dra/core.go b/test/integration/dra/core.go index 6d4bacdf849..876f7e2fac7 100644 --- a/test/integration/dra/core.go +++ b/test/integration/dra/core.go @@ -133,10 +133,11 @@ profiles: args: filterTimeout: 10ms `) - expectPodUnschedulable(tCtx, pod, "timed out trying to allocate devices") + expectPodSchedulerError(tCtx, pod, "timed out trying to allocate devices") // Update one slice such that allocation succeeds. - // The scheduler must retry and should succeed now. + // The scheduler retries automatically (timeouts go through + // backoff queue, not unschedulable pool) and should succeed now. createdOtherSlice.Spec.Devices = append(createdOtherSlice.Spec.Devices, resourceapi.Device{ Name: fmt.Sprintf("dev-%d", devicesPerSlice), }) diff --git a/test/integration/dra/helpers.go b/test/integration/dra/helpers.go index b52e6c10add..f3f24126dd2 100644 --- a/test/integration/dra/helpers.go +++ b/test/integration/dra/helpers.go @@ -272,6 +272,20 @@ func waitForClaimAllocatedToDevice(tCtx ktesting.TContext, namespace, claimName ) } +func expectPodSchedulerError(tCtx ktesting.TContext, pod *v1.Pod, reason string) { + tCtx.Helper() + tCtx.ExpectNoError(e2epod.WaitForPodCondition(tCtx, tCtx.Client(), pod.Namespace, pod.Name, v1.PodReasonSchedulerError, time.Minute, func(pod *v1.Pod) (bool, error) { + if pod.Status.Phase == v1.PodPending { + for _, cond := range pod.Status.Conditions { + if cond.Type == v1.PodScheduled && cond.Status == v1.ConditionFalse && cond.Reason == v1.PodReasonSchedulerError && strings.Contains(cond.Message, reason) { + return true, nil + } + } + } + return false, nil + }), fmt.Sprintf("expected pod to have scheduler error because %q", reason)) +} + func expectPodUnschedulable(tCtx ktesting.TContext, pod *v1.Pod, reason string) { tCtx.Helper() tCtx.ExpectNoError(e2epod.WaitForPodNameUnschedulableInNamespace(tCtx, tCtx.Client(), pod.Name, pod.Namespace), fmt.Sprintf("expected pod to be unschedulable because %q", reason))