dd9917ddce fixed one test which did not wait for
pods to be deleted and then, depending on the timing, left ResourceClaims
prepared because the driver stopped before kubelet could call
NodeUnprepareResources.
But this is a more systematic issue also with other tests, so now the any test
which starts a DRA plugin automatically uses the same common cleanup code:
- delete pods in the test names
- wait for the driver to not have any active ResourceClaims
- stop the driver
The E2E node test "[DRA] Two resource Kubelet Plugins [Serial] must provide metrics" was failing flakily due to a race condition.
The preceding test, "should not add health status to Pod when feature gate is disabled," was leaking an in-use ResourceClaim. It deleted its pod but did not wait for the Kubelet to finish unprepared the resources, leaving the `dra_resource_claims_in_use` metric at a non-zero value.
This commit makes the cleanup process synchronous so now it deletes the pod and explicitly waits for the `NodeUnprepareResources` gRPC call to complete making sure resources are released before the test finishes.
Additionally, I fixed the cleanup logic in the `createHealthTestPodAndClaim` helper function to prevent a `DeviceClass` leak.
getLocalNode tried to get a ready node and fails if there's none.
The e2e test sends termination signal to kubelet and it's expected to have no ready nodes. Because of this, the e2e was permafailing.
Signed-off-by: Ayato Tokubi <atokubi@redhat.com>
`framework.WithLabel("[FeatureGate:ResourceHealthStatus:Disabled]")` has no
effect unless a job explicitly uses it in a --label-filter, which is not what
"generic" alpha/beta jobs are meant to do. The test therefore ran in the new
dra-alpha-beta job and failed because it expected the feature to be off.
In addition, the square brackets got added twice (once via the string
parameter, once by `framework.WithLabel`).
There is no generic way to filter out tests in advance which depend on feature
gates to be turned off. In e2e_node tests the active feature gates can be
checked at runtime, so this is what the test now does.
keep only the test stub, as all the code was already
removed by PR in the series because superseded by
code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.
Signed-off-by: Francesco Romani <fromani@redhat.com>
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.
Signed-off-by: Francesco Romani <fromani@redhat.com>
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.
Signed-off-by: Francesco Romani <fromani@redhat.com>
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.
Signed-off-by: Francesco Romani <fromani@redhat.com>
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.
Signed-off-by: Francesco Romani <fromani@redhat.com>
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Updated ImageGCTerminatedPodsEviction to ImageGCTerminatedPodsContainersCleanup to test that
terminated containers are being cleaned up, instead of testing if terminated pods were being evicted
The test was panicking when trying to assign to a nil map in
initialConfig.FeatureGates["KubeletPodResourcesListUseActivePods"] = false.
Added nil check and map initialization to match the pattern used
elsewhere in the same file.
Fixes panic: internal/runtime/maps/runtime_faststr_swiss.go:265
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
The topology manager tests wants to run a subset of cpumanager tests
while checking numa alignment. We should eventually rewrite
these bits to reuse the new and cleaner rewritten cpu manager tests.
For the time being, we move the shared bits in the topology manager
tests, so we are now enabled to remove the remaining obsolete
cpu manager tests with the rewritten ones.
Trivial code movement, no intended behavioral changes.
Signed-off-by: Francesco Romani <fromani@redhat.com>
We're nearing the planned replacement of old cpumanager
tests with new ones, so move the remaining utilities
which we will keep using with the new codebase.
Trivial code movement, no intended behavioral changes.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Since is now all about criprozy, rename utils_linux.go
to better express the purpose.
Trivial code movement, no intended behavioral changes.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Push more utilities from cpu manager tests to util.go.
This time there is not a clear (or big enough)
them for this set of shared code blocks.
Trivial code movement, no intended behavioral changes.
Signed-off-by: Francesco Romani <fromani@redhat.com>
A lot ofe2e_node tests need to re-learn machine HW
properties to check the correctness of the behavior.
Over time, we start using these utilities among different
test groups (e.g. memory manager tests use cpu manager tests
utilites). So let's de-entangle this state by moving
the shared utilities in a separate util file.
Trivial code movement, no intended behavioral changes.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Is not ideal to heve utilities source file or packages,
because these tend to be unfocused and attract unstructured
code, easily leading to a kitchesink approach.
So, let's start cleaning up by splitting the utilities
we have to deal with kubelet config in its own source file,
lacking bandwidth now for deeper refactorings.
Trivial code movement, no intended behavioral changes.
Signed-off-by: Francesco Romani <fromani@redhat.com>
This change updates the Ginkgo label for the Device Plugin e2e tests for the ResourceHealthStatus feature.
By switching from `feature.ResourceHealthStatus` to `framework.WithFeatureGate(features.ResourceHealthStatus)`, these tests will now have the `[FeatureGate:ResourceHealthStatus]` label, making them consistent with the new DRA e2e tests for the same feature.
This standardization allows a single presubmit job in `test-infra` to correctly select and run all e2e tests for this feature, ensuring complete test coverage.