Skip to content

Commit 7d8ba78

Browse files
kannon92haircommander
authored andcommitted
priority pid tests should match on processes
pids 0 process should not be nonzero
1 parent 6e6b2b7 commit 7d8ba78

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pkg/kubelet/eviction/helpers.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ func process(stats statsFunc) cmpFunc {
738738

739739
p1Process := processUsage(p1Stats.ProcessStats)
740740
p2Process := processUsage(p2Stats.ProcessStats)
741-
// prioritize evicting the pod which has the larger consumption of process
742741
return int(p2Process - p1Process)
743742
}
744743
}

test/e2e_node/eviction_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo
475475

476476
highPriorityClassName := f.BaseName + "-high-priority"
477477
highPriority := int32(999999999)
478+
processes := 30000
478479

479480
ginkgo.Context(fmt.Sprintf(testContextFmt, expectedNodeCondition), func() {
480481
tempSetCurrentKubeletConfig(f, func(ctx context.Context, initialConfig *kubeletconfig.KubeletConfiguration) {
@@ -497,15 +498,15 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo
497498
specs := []podEvictSpec{
498499
{
499500
evictionPriority: 2,
500-
pod: pidConsumingPod("fork-bomb-container-with-low-priority", 12000),
501+
pod: pidConsumingPod("fork-bomb-container-with-low-priority", processes),
501502
},
502503
{
503504
evictionPriority: 0,
504505
pod: innocentPod(),
505506
},
506507
{
507508
evictionPriority: 1,
508-
pod: pidConsumingPod("fork-bomb-container-with-high-priority", 12000),
509+
pod: pidConsumingPod("fork-bomb-container-with-high-priority", processes),
509510
},
510511
}
511512
specs[1].pod.Spec.PriorityClassName = highPriorityClassName
@@ -524,7 +525,7 @@ var _ = SIGDescribe("PriorityPidEvictionOrdering", framework.WithSlow(), framewo
524525
specs := []podEvictSpec{
525526
{
526527
evictionPriority: 1,
527-
pod: pidConsumingPod("fork-bomb-container", 30000),
528+
pod: pidConsumingPod("fork-bomb-container", processes),
528529
wantPodDisruptionCondition: ptr.To(v1.DisruptionTarget),
529530
},
530531
}

test/e2e_node/summary_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ var _ = SIGDescribe("Summary API", framework.WithNodeConformance(), func() {
259259
"InodesUsed": bounded(0, 1e8),
260260
}),
261261
"ProcessStats": ptrMatchAllFields(gstruct.Fields{
262-
"ProcessCount": bounded(1, 1e8),
262+
"ProcessCount": bounded(0, 1e8),
263263
}),
264264
})
265265

0 commit comments

Comments
 (0)