test: adjust summary test for cgroup v2

on cgroup v2 the reported metric is recursive for the entire and it
includes all the sub cgroups.

Adjust the test accordingly.

Closes: https://github.com/kubernetes/kubernetes/issues/99230

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2021-06-09 14:04:04 +02:00
parent a3abd06ad5
commit c98306a09e
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED

View File

@ -115,6 +115,11 @@ var _ = SIGDescribe("Summary API [NodeConformance]", func() {
"UserDefinedMetrics": gomega.BeEmpty(),
})
}
expectedMajorPageFaultsUpperBound := 10
if IsCgroup2UnifiedMode() {
expectedMajorPageFaultsUpperBound = 1000
}
podsContExpectations := sysContExpectations().(*gstruct.FieldsMatcher)
podsContExpectations.Fields["Memory"] = ptrMatchAllFields(gstruct.Fields{
"Time": recent(maxStatsAge),
@ -124,7 +129,7 @@ var _ = SIGDescribe("Summary API [NodeConformance]", func() {
"WorkingSetBytes": bounded(10*e2evolume.Kb, memoryLimit),
"RSSBytes": bounded(1*e2evolume.Kb, memoryLimit),
"PageFaults": bounded(0, 1000000),
"MajorPageFaults": bounded(0, 10),
"MajorPageFaults": bounded(0, expectedMajorPageFaultsUpperBound),
})
runtimeContExpectations := sysContExpectations().(*gstruct.FieldsMatcher)
if systemdutil.IsRunningSystemd() && framework.TestContext.ContainerRuntime == "docker" {