Files
kubernetes/test
Patrick Ohly 93c8014f34 DRA integration: enforce better test isolation
Tests that are written as if they had the entire apiserver for themselves have
been a recurring problem. Ensuring that would limit us to start a new apiserver
and potentially other components (scheduler, resource claim controller) in
serial tests, which is slower.

Therefore all tests should create a test namespace and derive their driver name
from that, then create slices, classes and claims so that each test only uses
its own instances. If they don't, one test may allocate devices published by
another test. We cannot enforce how tests create their objects because there
may be many different valid ways, but we can detect incorrect allocation by
watching claims and checking their allocation result.

This detects the missing driver name selector in the explicit extended resource
tests (fixed in master already) like this:

    Claim all-explicitextendedresource-dk28h/my-pod-extended-resources-xtcgq has allocated device v1.DeviceRequestAllocationResult{Request:"container-0-request-0", Driver:"driver-all-evictclusterwithrule-slh8g", Pool:"cluster", Device:"device-700", AdminAccess:(*bool)(nil), Tolerations:[]v1.DeviceToleration(nil), BindingConditions:[]string(nil), BindingFailureConditions:[]string(nil), ShareID:(*types.UID)(nil), ConsumedCapacity:map[v1.QualifiedName]resource.Quantity(nil)} from a driver in some other test (driver-all-evictclusterwithrule-slh8g):
      <*v1.ResourceClaim | 0x2d8b54b4820>:
        [...]

The ResourceClaim status simulates device allocation. To avoid false positives,
it needs to use unique driver names like the other tests.
2026-03-17 07:57:02 +01:00
..
2026-02-05 17:21:34 +00:00