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.
This commit is contained in:
Clayton Coleman 2020-04-19 15:08:00 -04:00
parent 3c44e11cfa
commit 1e4e0759e8
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3

View File

@ -1491,6 +1491,11 @@ func newTestPodForQuota(f *framework.Framework, name string, requests v1.Resourc
Name: name,
},
Spec: v1.PodSpec{
// prevent disruption to other test workloads in parallel test runs by ensuring the quota
// test pods don't get scheduled onto a node
NodeSelector: map[string]string{
"x-test.k8s.io/unsatisfiable": "not-schedulable",
},
Containers: []v1.Container{
{
Name: "pause",
@ -1512,6 +1517,11 @@ func newTestPodForQuotaWithPriority(f *framework.Framework, name string, request
Name: name,
},
Spec: v1.PodSpec{
// prevent disruption to other test workloads in parallel test runs by ensuring the quota
// test pods don't get scheduled onto a node
NodeSelector: map[string]string{
"x-test.k8s.io/unsatisfiable": "not-schedulable",
},
Containers: []v1.Container{
{
Name: "pause",