priority pid tests should match on processes

pids 0
process should not be nonzero
This commit is contained in:
Kevin Hannon 2024-02-12 12:03:57 -05:00 committed by Peter Hunt
parent 6e6b2b76a3
commit 7d8ba7849b
3 changed files with 5 additions and 5 deletions

View File

@ -738,7 +738,6 @@ func process(stats statsFunc) cmpFunc {
p1Process := processUsage(p1Stats.ProcessStats) p1Process := processUsage(p1Stats.ProcessStats)
p2Process := processUsage(p2Stats.ProcessStats) p2Process := processUsage(p2Stats.ProcessStats)
// prioritize evicting the pod which has the larger consumption of process
return int(p2Process - p1Process) return int(p2Process - p1Process)
} }
} }

View File

@ -475,6 +475,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo
highPriorityClassName := f.BaseName + "-high-priority" highPriorityClassName := f.BaseName + "-high-priority"
highPriority := int32(999999999) highPriority := int32(999999999)
processes := 30000
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() { ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
tempSetCurrentKubeletConfig(f, func(ctx context.Context, initialConfig *kubeletconfig.KubeletConfiguration) { tempSetCurrentKubeletConfig(f, func(ctx context.Context, initialConfig *kubeletconfig.KubeletConfiguration) {
@ -497,7 +498,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo
specs := []podEvictSpec{ specs := []podEvictSpec{
{ {
evictionPriority: 2, evictionPriority: 2,
pod: pidConsumingPod("fork-bomb-container-with-low-priority", 12000), pod: pidConsumingPod("fork-bomb-container-with-low-priority", processes),
}, },
{ {
evictionPriority: 0, evictionPriority: 0,
@ -505,7 +506,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo
}, },
{ {
evictionPriority: 1, evictionPriority: 1,
pod: pidConsumingPod("fork-bomb-container-with-high-priority", 12000), pod: pidConsumingPod("fork-bomb-container-with-high-priority", processes),
}, },
} }
specs[1].pod.Spec.PriorityClassName = highPriorityClassName specs[1].pod.Spec.PriorityClassName = highPriorityClassName
@ -524,7 +525,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo
specs := []podEvictSpec{ specs := []podEvictSpec{
{ {
evictionPriority: 1, evictionPriority: 1,
pod: pidConsumingPod("fork-bomb-container", 30000), pod: pidConsumingPod("fork-bomb-container", processes),
wantPodDisruptionCondition: ptr.To(v1.DisruptionTarget), wantPodDisruptionCondition: ptr.To(v1.DisruptionTarget),
}, },
} }

View File

@ -259,7 +259,7 @@ var _ = SIGDescribe("Summary API", framework.WithNodeConformance(), func() {
"InodesUsed": bounded(0, 1e8), "InodesUsed": bounded(0, 1e8),
}), }),
"ProcessStats": ptrMatchAllFields(gstruct.Fields{ "ProcessStats": ptrMatchAllFields(gstruct.Fields{
"ProcessCount": bounded(1, 1e8), "ProcessCount": bounded(0, 1e8),
}), }),
}) })