From 7d8ba7849b1f50a9fb5042f085b9490e374732e8 Mon Sep 17 00:00:00 2001 From: Kevin Hannon Date: Mon, 12 Feb 2024 12:03:57 -0500 Subject: [PATCH] priority pid tests should match on processes pids 0 process should not be nonzero --- pkg/kubelet/eviction/helpers.go | 1 - test/e2e_node/eviction_test.go | 7 ++++--- test/e2e_node/summary_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/kubelet/eviction/helpers.go b/pkg/kubelet/eviction/helpers.go index 8050613e672..8c57bc2d25d 100644 --- a/pkg/kubelet/eviction/helpers.go +++ b/pkg/kubelet/eviction/helpers.go @@ -738,7 +738,6 @@ func process(stats statsFunc) cmpFunc { p1Process := processUsage(p1Stats.ProcessStats) p2Process := processUsage(p2Stats.ProcessStats) - // prioritize evicting the pod which has the larger consumption of process return int(p2Process - p1Process) } } diff --git a/test/e2e_node/eviction_test.go b/test/e2e_node/eviction_test.go index 2f3375e3e65..c518fdb42cb 100644 --- a/test/e2e_node/eviction_test.go +++ b/test/e2e_node/eviction_test.go @@ -475,6 +475,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo highPriorityClassName := f.BaseName + "-high-priority" highPriority := int32(999999999) + processes := 30000 ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() { tempSetCurrentKubeletConfig(f, func(ctx context.Context, initialConfig *kubeletconfig.KubeletConfiguration) { @@ -497,7 +498,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo specs := []podEvictSpec{ { evictionPriority: 2, - pod: pidConsumingPod("fork-bomb-container-with-low-priority", 12000), + pod: pidConsumingPod("fork-bomb-container-with-low-priority", processes), }, { evictionPriority: 0, @@ -505,7 +506,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo }, { 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 @@ -524,7 +525,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo specs := []podEvictSpec{ { evictionPriority: 1, - pod: pidConsumingPod("fork-bomb-container", 30000), + pod: pidConsumingPod("fork-bomb-container", processes), wantPodDisruptionCondition: ptr.To(v1.DisruptionTarget), }, } diff --git a/test/e2e_node/summary_test.go b/test/e2e_node/summary_test.go index 77c2fa394a6..948d3605cf5 100644 --- a/test/e2e_node/summary_test.go +++ b/test/e2e_node/summary_test.go @@ -259,7 +259,7 @@ var _ = SIGDescribe("Summary API", framework.WithNodeConformance(), func() { "InodesUsed": bounded(0, 1e8), }), "ProcessStats": ptrMatchAllFields(gstruct.Fields{ - "ProcessCount": bounded(1, 1e8), + "ProcessCount": bounded(0, 1e8), }), })