Commit graph

98 commits

Author SHA1 Message Date
Francesco Romani
9bc91a75d3 e2e: cpumanager: test for custom cpu cfs quota period
Add basic e2e test coverage for the CFSCPUPeriod toggle

Signed-off-by: Francesco Romani <fromani@redhat.com>
2026-02-09 08:27:51 +01:00
Maria Romano Silva
86bfcd5eec oopsie missed two, should fix failing tests 2025-10-28 01:26:32 +00:00
Patrick Ohly
d0a2a0d22e e2e: find and fix reuse of test names
This reports and fixes for test/e2e:

    ERROR: E2E suite initialization was faulty, these errors must be fixed:
    ERROR: apimachinery/mutatingadmissionpolicy.go:184: full test name is not unique: "[sig-api-machinery] MutatingAdmissionPolicy [Privileged:ClusterAdmin] [Feature:MutatingAdmissionPolicy] [FeatureGate:MutatingAdmissionPolicy] [Beta] [Feature:OffByDefault] should support MutatingAdmissionPolicy API operations" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e/apimachinery/mutatingadmissionpolicy.go:184, /nvme/gopath/src/k8s.io/kubernetes/test/e2e/apimachinery/mutatingadmissionpolicy.go:606)
    ERROR: apimachinery/mutatingadmissionpolicy.go:412: full test name is not unique: "[sig-api-machinery] MutatingAdmissionPolicy [Privileged:ClusterAdmin] [Feature:MutatingAdmissionPolicy] [FeatureGate:MutatingAdmissionPolicy] [Beta] [Feature:OffByDefault] should support MutatingAdmissionPolicyBinding API operations" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e/apimachinery/mutatingadmissionpolicy.go:412, /nvme/gopath/src/k8s.io/kubernetes/test/e2e/apimachinery/mutatingadmissionpolicy.go:834)
    ERROR: common/node/pod_level_resources.go:250: full test name is not unique: "[sig-node] Pod Level Resources [Serial] [Feature:PodLevelResources] [FeatureGate:PodLevelResources] [Beta] Guaranteed QoS pod with container resources" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e/common/node/pod_level_resources.go:250 (2x))
    ERROR: dra/dra.go:1899: full test name is not unique: "[sig-node] [DRA] kubelet [Feature:DynamicResourceAllocation] [FeatureGate:DRAConsumableCapacity] [Alpha] [Feature:OffByDefault] [FeatureGate:DynamicResourceAllocation] must allow multiple allocations and consume capacity [KubeletMinVersion:1.34]" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e/dra/dra.go:1899 (2x))
    ERROR: storage/testsuites/volume_group_snapshottable.go:173: full test name is not unique: "[sig-storage] CSI Volumes [Driver: csi-hostpath] [Testpattern:  (delete policy)] volumegroupsnapshottable [Feature:volumegroupsnapshot] VolumeGroupSnapshottable  should create snapshots for multiple volumes in a pod" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e/storage/testsuites/volume_group_snapshottable.go:173 (2x))
    ERROR: storage/testsuites/volume_group_snapshottable.go:173: full test name is not unique: "[sig-storage] CSI Volumes [Driver: pd.csi.storage.gke.io] [Serial] [Testpattern:  (delete policy)] volumegroupsnapshottable [Feature:volumegroupsnapshot] VolumeGroupSnapshottable  should create snapshots for multiple volumes in a pod" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e/storage/testsuites/volume_group_snapshottable.go:173 (2x))

And for test/e2e_node:

    ERROR: cpu_manager_test.go:1622: full test name is not unique: "[sig-node] CPU Manager [Serial] [Feature:CPUManager] when checking the CFS quota management should disable for guaranteed pod with exclusive CPUs assigned" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e_node/cpu_manager_test.go:1622, /nvme/gopath/src/k8s.io/kubernetes/test/e2e_node/cpu_manager_test.go:1642)
    ERROR: eviction_test.go:800: full test name is not unique: "[sig-node] LocalStorageCapacityIsolationFSQuotaMonitoring [Slow] [Serial] [Disruptive] [Feature:LocalStorageCapacityIsolationQuota] [Feature:LSCIQuotaMonitoring] [Feature:UserNamespacesSupport] when we run containers that should cause use quotas for LSCI monitoring (quotas enabled: true)  should eventually evict all of the correct pods" (/nvme/gopath/src/k8s.io/kubernetes/test/e2e_node/eviction_test.go:800 (2x))
2025-10-17 20:19:52 +02:00
Francesco Romani
9aed0813e6 e2e: node: cpumgr: replace old testsuite
This final change in the series completes the transition
to the new test suite

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-28 12:02:27 +02:00
Francesco Romani
c4f7272f62 e2e: node: cpumgr: keep only scaffolding
keep only the test stub, as all the code was already
removed by PR in the series because superseded by
code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-28 11:51:40 +02:00
Francesco Romani
37d678e098 e2e: node: cpumgr: remove old sidecar container tests
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-28 11:51:40 +02:00
Francesco Romani
666dec8c2f e2e: node: cpumgr: remove old reserved cpus tests
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-28 11:51:40 +02:00
Francesco Romani
d98069e22c e2e: node: cpumgr: remove old distribute-cpus tests
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-28 11:51:40 +02:00
Francesco Romani
e2624d0cce e2e: node: cpumgr: remove old smt alignment tests
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-28 11:51:40 +02:00
Francesco Romani
9e6073304f e2e: node: cpumgr: remove old cfs quota tests
superseded by code in cpumanager_test.go,
which will be moved in cpu_manager_test.go at the
end of this series.
Split to make the review easier.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-28 11:51:40 +02:00
Francesco Romani
e839adafb7 e2e: node: cpumanager: move shared code in topology manager tests
The topology manager tests wants to run a subset of cpumanager tests
while checking numa alignment. We should eventually rewrite
these bits to reuse the new and cleaner rewritten cpu manager tests.
For the time being, we move the shared bits in the topology manager
tests, so we are now enabled to remove the remaining obsolete
cpu manager tests with the rewritten ones.

Trivial code movement, no intended behavioral changes.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-11 14:46:07 +02:00
Francesco Romani
af53d97786 e2e: node: cpumanager: move specific helpers
We're nearing the planned replacement of old cpumanager
tests with new ones, so move the remaining utilities
which we will keep using with the new codebase.

Trivial code movement, no intended behavioral changes.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-11 14:46:07 +02:00
Francesco Romani
30ca634386 e2e: node: cpumanager: push utilities in util.go
Push more utilities from cpu manager tests to util.go.
This time there is not a clear (or big enough)
them for this set of shared code blocks.

Trivial code movement, no intended behavioral changes.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-11 14:46:07 +02:00
Francesco Romani
bb7cff161c e2e: node: split utilities to learn machine properties
A lot ofe2e_node  tests need to re-learn machine HW
properties to check the correctness of the behavior.
Over time, we start using these utilities among different
test groups (e.g. memory manager tests use cpu manager tests
utilites). So let's de-entangle this state by moving
the shared utilities in a separate util file.

Trivial code movement, no intended behavioral changes.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-08-11 14:46:07 +02:00
Francesco Romani
a3a767b37e WIP: fix e2e tests
Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-07-29 20:20:08 +02:00
Francesco Romani
13bd0b4ee8 e2e: node: rewrite the sidecar related tests
rewrite the tests porting to the new layout and utilities.
We may add more cases and better integration in the future.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:05 +02:00
Francesco Romani
e4726719a7 e2e: node: rewrite more compatibility tests
Complete the rewrite the policy option compatibility tests,
rewriting the tests which check compatibility
between the `full-pcpus-only` and `distribute-cpus-across-numa`.

All testcases are preserved.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
dd3f9b6074 e2e: node: rewrite CFS quota tests
Rewrite the e2e cpumanager tests about CFS quota management.
All testcases are preserved.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Davanum Srinivas
d429c8b17d
debug cpu_manager_test failure
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-03-24 19:15:38 -04:00
Francesco Romani
3c7ed00e22 node: kep-2625: cpu manager policy options GA
Move the support for CPUManager Policy Options to GA

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-20 08:31:32 +01:00
Kubernetes Prow Robot
fba63656c9
Merge pull request #130498 from swatisehgal/distribute-across-numa-e2e-tests
node: cpumgr: e2e: Tests for `distribute-cpus-across-numa` policy option
2025-03-19 10:19:06 -07:00
Swati Sehgal
327ebcffc8 node: cpumgr: e2e: Define constants and use them instead of literals
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2025-03-19 13:19:20 +00:00
Swati Sehgal
c90f0539c8 node: cpumgr: e2e: Tests for distribute-cpus-across-numa policy option
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2025-03-19 13:19:03 +00:00
Mark Sasnal
5625483527 KEP-4540: added e2e tests for strict-cpu-reservation option 2025-03-18 11:52:25 -04:00
Francesco Romani
5c17e7bd9c node: cpumgr: metrics: add uncore cache alignment metrics
add missing metric about uncore / L3 / Last-Level cache alignment,
plus its e2e tests.

Exposing uncore alignment requires a bit of refactoring in the static
policy implementation because, differently from full PCPUs alignment
and NUMA alignment, can't be easily and safely inferred by construction.

The main reason for this is that uncore cache alignment is preferred,
not mandatory, thus the cpu allocator can legally use cross-uncore
allocation. Because of that, the final cpuset union step can
create a final cpuset which is not uncore-aligned even though all
its parts are uncore-aligned.

The safest way seems thus to run just a final uncore-alignment check
once the final cpuset is computed.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-14 09:08:54 +01:00
Francesco Romani
323410664c e2e: node: cpumgr: check CPU allocatable for CFS quota test
add (admittedly pretty crude) CPU allocatable check.
A more incisive refactoring is needed, but we need
to unbreak CI first, so this seems the minimal decently clean test.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-02-18 10:04:57 +01:00
Francesco Romani
844c2ef39d e2e: node: cpumgr: cleanup after each test case
Our CI machines happen to have 1 fully allocatable CPU for test workloads.
This is really, really the minimal amount. But still should be sufficient for the tests to run
the tests; the CFS quota pod, however, does create a series of pods (at time of writing, 6)
and does the cleanup only at the very end the end. This means pods
requiring resources accumulate on the CI machine node.

The fix implemented here is to just clean up after each subcase.
Doing so the cpu test footprint is equal to the higher requirement (say, 1000 millicores) vs
the sum of all the subcases requirements.

Doing like this doesn't change the test behavior, and make it possible
to run it on very barebones machines.
2025-02-14 15:45:36 +01:00
Scott Grimes
1c5170ff52 disable cfs quota when exclusive cpus allocated per static cpu policy requirements 2025-02-11 13:42:30 -05:00
Kubernetes Prow Robot
29bf17b6cf
Merge pull request #129168 from kannon92/drop-node-features
[KEP-3041] - remove nodefeatures from k/k repo
2025-01-23 12:07:29 -08:00
Sotiris Salloumis
c5fc4193bb Fix pod delete issues in podresize tests 2025-01-21 07:25:14 +01:00
Kevin Hannon
bae4122f56 deprecate nodefeature for feature labels 2025-01-20 17:02:59 -05:00
Kevin Hannon
8495df64b2 deprecate nodefeature for feature labels 2024-12-17 13:58:12 -05:00
Sujay
223aedcf6b enhance boolean assertions 2024-07-31 15:58:15 +00:00
Sotiris Salloumis
87e113261d e2e_node: clean cpu_manager test 2024-03-28 12:41:07 +01:00
Gunju Kim
1cd1092dd9
Remove NodeAlphaFeature label from sidecar e2e tests 2023-11-06 19:50:05 +09:00
Patrick Ohly
f2cfbf44b1 e2e: use framework labels
This changes the text registration so that tags for which the framework has a
dedicated API (features, feature gates, slow, serial, etc.) those APIs are
used.

Arbitrary, custom tags are still left in place for now.
2023-11-01 15:17:34 +01:00
Kubernetes Prow Robot
bfeb3c2621
Merge pull request #119447 from gjkim42/do-not-reuse-cpu-set-of-restartable-init-container
Don't reuse CPU set of a restartable init container
2023-10-31 19:15:26 +01:00
carlory
d5d7fb595e e2e_node: stop using deprecated framework.ExpectEqual 2023-10-09 16:42:42 +08:00
Gunju Kim
8b5f30ef09
Don't reuse CPU set of a restartable init container 2023-10-06 22:16:15 +09:00
Sascha Grunert
a6554b9d5d
Make kubelet label types public
We use the label definitions in CRI-O, means we now make them public to
stop vendoring/copying this part of Kubernetes.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-07-10 10:58:44 +02:00
Stanislav Laznicka
7f532891c9
e2e tests: set all PSa labels instead of just enforcing 2023-06-21 15:05:13 +02:00
Ian K. Coolidge
cede96336a Depend on k8s.io/utils cpuset
Steps performed:

$ find . -name '*.go' -exec sed -i
's|k8s.io/kubernetes/pkg/kubelet/cm/cpuset|k8s.io/utils/cpuset|g' {} \
$ ./hack/update-vendor.sh
$ ./hack/update-gofmt.sh
$ git rm -r pkg/kubelet/cm/cpuset/
2023-05-03 16:26:09 +00:00
Ian K. Coolidge
cbb985a310 cpuset: Delete 'builder' methods
All usage of builder pattern is convertible to cpuset.New()
with the same or fewer lines of code.

Migrate Builder.Add to a private method of CPUSet, with a comment
that it is only intended for internal use to preserve immutable
propoerty of the exported interface.

This also removes 'require' library dependency, which avoids
non-standard library usage.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
f3829c4be3 cpuset: Rename 'NewCPUSet' to 'New' 2023-01-06 23:32:51 +00:00
Ian K. Coolidge
e5143d16c2 cpuset: Make 'ToSlice*' methods look like 'set' methods
In 'set', conversions to slice are done also, but with different names:

ToSliceNoSort() -> UnsortedList()
ToSlice() -> List()

Reimplement List() in terms of UnsortedList to save some duplication.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
67a057d4f2 cpuset: Remove 'MustParse' method
Removes exit/fatal from cpuset library.

Usage in podresources test was not necessary.

Library reference in cpu_manager_test was moved to a local function, and
converted to use e2e test framework error catching.
2023-01-06 23:32:51 +00:00
Patrick Ohly
2f6c4f5eab e2e: use Ginkgo context
All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
2022-12-16 20:14:04 +01:00
Kubernetes Prow Robot
770b39c65b
Merge pull request #114072 from Tal-or/deflake_e2e_cpumanager_metrics_tests
e2e: cpumanager: proper test clean-up
2022-12-14 11:55:45 -08:00
Patrick Ohly
df5d84ae81 e2e: accept context from Ginkgo
Every ginkgo callback should return immediately when a timeout occurs or the
test run manually gets aborted with CTRL-C. To do that, they must take a ctx
parameter and pass it through to all code which might block.

This is a first automated step towards that: the additional parameter got added
with

    sed -i 's/\(framework.ConformanceIt\|ginkgo.It\)\(.*\)func() {$/\1\2func(ctx context.Context) {/' \
        $(git grep -l -e framework.ConformanceIt -e ginkgo.It )
    $GOPATH/bin/goimports -w $(git status | grep modified: | sed -e 's/.* //')

log_test.go was left unchanged.
2022-12-10 19:50:18 +01:00
Talor Itzhak
56c5a95849 e2e: cpumanager: proper test clean-up
One of the cpumanager tests doesn't remove the pod
that got created during the test.

This causes pollution of other tests and failures
from time to time (depends on the test execution order).

In order to defalke the tests, we should delete the pod
and wait for it to be completely remove.

Signed-off-by: Talor Itzhak <titzhak@redhat.com>
2022-11-22 17:25:52 +02:00