mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
DRA: serialize binding conditions integration tests with custom scheduler config
This commit is contained in:
@@ -41,9 +41,12 @@ var (
|
||||
|
||||
// testDeviceBindingConditions is the entry point for running each integration test that verifies DeviceBindingConditions.
|
||||
// Some of these tests use device taints, and they assume that DRADeviceTaints is enabled.
|
||||
//
|
||||
// In addition, some tests use custom scheduler configuration and therefore
|
||||
// can't run in parallel. The ones that use the default scheduler configuration
|
||||
// will run in parallel with each other, but not in parallel with
|
||||
// non-DeviceBindingConditions tests.
|
||||
func testDeviceBindingConditions(tCtx ktesting.TContext, enabled bool) {
|
||||
tCtx.Parallel()
|
||||
|
||||
tCtx.Run("BasicFlow", func(tCtx ktesting.TContext) { testDeviceBindingConditionsBasicFlow(tCtx, enabled) })
|
||||
if enabled {
|
||||
tCtx.Run("FailureTaints", func(tCtx ktesting.TContext) { testDeviceBindingFailureConditionsReschedule(tCtx, true) })
|
||||
@@ -58,6 +61,8 @@ func testDeviceBindingConditions(tCtx ktesting.TContext, enabled bool) {
|
||||
// The second pod then uses the device with BindingConditions. The test checks that the scheduler retries
|
||||
// after an initial binding failure of the second pod, ensuring successful scheduling after rescheduling.
|
||||
func testDeviceBindingConditionsBasicFlow(tCtx ktesting.TContext, enabled bool) {
|
||||
tCtx.Parallel()
|
||||
|
||||
namespace := createTestNamespace(tCtx, nil)
|
||||
class, driverName := createTestClass(tCtx, namespace)
|
||||
startScheduler(tCtx)
|
||||
@@ -229,6 +234,8 @@ func testDeviceBindingConditionsBasicFlow(tCtx ktesting.TContext, enabled bool)
|
||||
// Device preparation failure is simulated in two ways: by applying DeviceTaints or by removing the device from ResourceSlice.
|
||||
// The simulation method is controlled via the `useTaints` argument: when true, DeviceTaints are used; when false, the device is removed from ResourceSlice.
|
||||
func testDeviceBindingFailureConditionsReschedule(tCtx ktesting.TContext, useTaints bool) {
|
||||
tCtx.Parallel()
|
||||
|
||||
namespace := createTestNamespace(tCtx, nil)
|
||||
class, driverName := createTestClass(tCtx, namespace)
|
||||
startScheduler(tCtx)
|
||||
@@ -381,6 +388,8 @@ func testDeviceBindingFailureConditionsReschedule(tCtx ktesting.TContext, useTai
|
||||
|
||||
// testBindingConditionsTimeoutReachedd verifies that a short bindingTimeout triggers
|
||||
// a PreBind timeout when the required BindingConditions never become true.
|
||||
//
|
||||
// It runs the scheduler with non-standard settings and thus cannot run in parallel.
|
||||
func testDeviceBindingConditionsTimeoutReached(tCtx ktesting.TContext) {
|
||||
namespace := createTestNamespace(tCtx, nil)
|
||||
class, driver := createTestClass(tCtx, namespace)
|
||||
@@ -481,6 +490,8 @@ profiles:
|
||||
// testDeviceBindingConditionsTimeoutRecovery verifies that when a device with BindingConditions
|
||||
// fails to become ready within the timeout (BindingTimeout enforced), and a new device without
|
||||
// binding conditions is added, the scheduler reschedules the claim to the new available device.
|
||||
//
|
||||
// It runs the scheduler with non-standard settings and thus cannot run in parallel.
|
||||
func testDeviceBindingConditionsTimeoutRecovery(tCtx ktesting.TContext) {
|
||||
namespace := createTestNamespace(tCtx, nil)
|
||||
class, driverName := createTestClass(tCtx, namespace)
|
||||
|
||||
Reference in New Issue
Block a user