Merge pull request #43242 from timstclair/summary-test

Automatic merge from submit-queue

Relax 'misc' container memory constraints

Fixes https://github.com/kubernetes/kubernetes/issues/40607

/cc @dchen1107
This commit is contained in:
Kubernetes Submit Queue 2017-03-16 15:25:23 -07:00 committed by GitHub
commit 5e0f0047dd

View File

@ -69,7 +69,8 @@ var _ = framework.KubeDescribe("Summary API", func() {
) )
fsCapacityBounds := bounded(100*mb, 100*gb) fsCapacityBounds := bounded(100*mb, 100*gb)
// Expectations for system containers. // Expectations for system containers.
sysContExpectations := gstruct.MatchAllFields(gstruct.Fields{ sysContExpectations := func() types.GomegaMatcher {
return gstruct.MatchAllFields(gstruct.Fields{
"Name": gstruct.Ignore(), "Name": gstruct.Ignore(),
"StartTime": recent(maxStartAge), "StartTime": recent(maxStartAge),
"CPU": ptrMatchAllFields(gstruct.Fields{ "CPU": ptrMatchAllFields(gstruct.Fields{
@ -91,14 +92,27 @@ var _ = framework.KubeDescribe("Summary API", func() {
"Logs": BeNil(), "Logs": BeNil(),
"UserDefinedMetrics": BeEmpty(), "UserDefinedMetrics": BeEmpty(),
}) })
}
systemContainers := gstruct.Elements{ systemContainers := gstruct.Elements{
"kubelet": sysContExpectations, "kubelet": sysContExpectations(),
"runtime": sysContExpectations, "runtime": sysContExpectations(),
} }
// The Kubelet only manages the 'misc' system container if the host is not running systemd. // The Kubelet only manages the 'misc' system container if the host is not running systemd.
if !systemdutil.IsRunningSystemd() { if !systemdutil.IsRunningSystemd() {
framework.Logf("Host not running systemd; expecting 'misc' system container.") framework.Logf("Host not running systemd; expecting 'misc' system container.")
systemContainers["misc"] = sysContExpectations miscContExpectations := sysContExpectations().(*gstruct.FieldsMatcher)
// Misc processes are system-dependent, so relax the memory constraints.
miscContExpectations.Fields["Memory"] = ptrMatchAllFields(gstruct.Fields{
"Time": recent(maxStatsAge),
// We don't limit system container memory.
"AvailableBytes": BeNil(),
"UsageBytes": bounded(100*kb, 10*gb),
"WorkingSetBytes": bounded(100*kb, 10*gb),
"RSSBytes": bounded(100*kb, 1*gb),
"PageFaults": bounded(1000, 1E9),
"MajorPageFaults": bounded(0, 100000),
})
systemContainers["misc"] = miscContExpectations
} }
// Expectations for pods. // Expectations for pods.
podExpectations := gstruct.MatchAllFields(gstruct.Fields{ podExpectations := gstruct.MatchAllFields(gstruct.Fields{