Merge pull request #102726 from giuseppe/fix-summary-test

test: adjust summary test for cgroup v2
This commit is contained in:
Kubernetes Prow Robot 2021-06-10 16:04:12 -07:00 committed by GitHub
commit f32dd210a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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