Files
kubernetes/test
Patrick Ohly 4a353d07e4 E2E ResourceQuota: fix pod creation flake
As can be seen in the output of a test failure in the CI, the test waits for
"quota-not-terminating" to be updated, but then fails because creating the pod
exceeds the "quota-terminating" quota which has not been updated yet. As both
ResourceQuotas apply, it needs to wait for both of them to be updated.

    STEP: Deleting the pod - k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:1597 @ 05/18/25 07:50:46.531
    STEP: Ensuring resource quota status released the pod usage - k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:1601 @ 05/18/25 07:50:46.547
    I0518 07:50:46.551520 75078 resource_quota.go:2508] Got expected ResourceQuota:
    ...
              name: quota-not-terminating
              namespace: scope-selectors-1836
              resourceVersion: "15914"
              uid: db72668e-2fe0-4543-ada2-a3ff0ac77dd5
            spec:
              hard:
                limits.cpu: "2"
                limits.memory: 1Gi
                pods: "1"
                requests.cpu: "1"
                requests.memory: 500Mi
              scopeSelector:
                matchExpressions:
                - operator: Exists
                  scopeName: NotTerminating
            status:
              hard:
                limits.cpu: "2"
                limits.memory: 1Gi
                pods: "1"
                requests.cpu: "1"
                requests.memory: 500Mi
              used:
                limits.cpu: "0"
                limits.memory: "0"
                pods: "0"
                requests.cpu: "0"
                requests.memory: "0"
    STEP: Creating a terminating pod - k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:1610 @ 05/18/25 07:50:46.551
    I0518 07:50:46.560944 75078 resource_quota.go:1612] Unexpected error:
        <*errors.StatusError | 0xc002dba500>:
        pods "terminating-pod" is forbidden: exceeded quota: quota-terminating, requested: pods=1, used: pods=1, limited: pods=1
        {
            ErrStatus:
                code: 403
                details:
                  kind: pods
                  name: terminating-pod
                message: 'pods "terminating-pod" is forbidden: exceeded quota: quota-terminating,
                  requested: pods=1, used: pods=1, limited: pods=1'
                metadata: {}
                reason: Forbidden
                status: Failure,
        }
    [FAILED] pods "terminating-pod" is forbidden: exceeded quota: quota-terminating, requested: pods=1, used: pods=1, limited: pods=1
2025-05-19 15:36:57 +02:00
..
2025-05-05 08:25:20 +02:00
2025-05-16 13:28:37 +05:30