Skip to content

Commit 1e4e075

Browse files
test: PriorityClass resource quota tests should not cause preemption
During a parallel test run these tests were observed to cause a preemption of another test: ``` Apr 19 16:59:06.749: INFO: At 2020-04-19 16:58:52 +0000 UTC - event for pod-init-b6fbd440-dbc2-454a-b31a-ce44266298d1: {default-scheduler } Scheduled: Successfully assigned e2e-init-container-7691/pod-init-b6fbd440-dbc2-454a-b31a-ce44266298d1 to ip-10-0-148-234.us-west-2.compute.internal Apr 19 16:59:06.750: INFO: At 2020-04-19 16:58:54 +0000 UTC - event for pod-init-b6fbd440-dbc2-454a-b31a-ce44266298d1: {default-scheduler } Preempted: Preempted by e2e-resourcequota-priorityclass-8850/testpod-pclass9 on node ip-10-0-148-234.us-west-2.compute.internal ``` These tests have no need to actually land on a node to validate resource quota and so we can set an impossible scheduling condition. Hopefully we don't have tests that too broadly check impossible scheduling conditions.
1 parent 3c44e11 commit 1e4e075

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/e2e/apimachinery/resource_quota.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,11 @@ func newTestPodForQuota(f *framework.Framework, name string, requests v1.Resourc
14911491
Name: name,
14921492
},
14931493
Spec: v1.PodSpec{
1494+
// prevent disruption to other test workloads in parallel test runs by ensuring the quota
1495+
// test pods don't get scheduled onto a node
1496+
NodeSelector: map[string]string{
1497+
"x-test.k8s.io/unsatisfiable": "not-schedulable",
1498+
},
14941499
Containers: []v1.Container{
14951500
{
14961501
Name: "pause",
@@ -1512,6 +1517,11 @@ func newTestPodForQuotaWithPriority(f *framework.Framework, name string, request
15121517
Name: name,
15131518
},
15141519
Spec: v1.PodSpec{
1520+
// prevent disruption to other test workloads in parallel test runs by ensuring the quota
1521+
// test pods don't get scheduled onto a node
1522+
NodeSelector: map[string]string{
1523+
"x-test.k8s.io/unsatisfiable": "not-schedulable",
1524+
},
15151525
Containers: []v1.Container{
15161526
{
15171527
Name: "pause",

0 commit comments

Comments
 (0)