Fix the preemption test

It needs to run as [Serial], so it accidentally does not evict other Pods.

Consider this scenario on a busy clusters, with all nodes at their attachment limit.

1. pod1 of the preemption test runs, pod2 is created.
2. The scheduler evicts pod1. That frees the RWOP volume and it also frees the last attachment slot on the node.
3. Some other e2e tests creates a Pod and scheduler puts it on a node, taking the last attachment slot.
4. The scheduler schedules pod2 agaian and it sees there is no node with a free attachment slot -> new round of eviction, now evicting a pod of unrelated e2e tests. The unrelated test will fail.
This commit is contained in:
Jan Safranek
2025-12-05 14:28:22 +01:00
parent 4e94e70dca
commit 618bec889d

View File

@@ -130,7 +130,7 @@ func (t *readWriteOncePodTestSuite) DefineTests(driver storageframework.TestDriv
ginkgo.DeferCleanup(cleanup)
})
ginkgo.It("should preempt lower priority pods using ReadWriteOncePod volumes", func(ctx context.Context) {
ginkgo.It("should preempt lower priority pods using ReadWriteOncePod volumes", ginkgo.Serial, func(ctx context.Context) {
// Create the ReadWriteOncePod PVC.
accessModes := []v1.PersistentVolumeAccessMode{v1.ReadWriteOncePod}
l.volume = storageframework.CreateVolumeResourceWithAccessModes(ctx, driver, l.config, pattern, t.GetTestSuiteInfo().SupportedSizeRange, accessModes, nil)