From 45dfe3011c589ce80f8add6eccd0bb6e867b5389 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 14 Dec 2025 14:11:13 +0100 Subject: [PATCH] refactor(TestFindDuplicatePods): inline p10 pod creation --- .../plugins/removeduplicates/removeduplicates_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go index 050896476..2923c7454 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go @@ -97,7 +97,6 @@ func TestFindDuplicatePods(t *testing.T) { // A Mirror Pod. // A Critical Pod. // Three Pods in the "test" Namespace, bound to same ReplicaSet. 2 should be evicted. - p10 := buildTestPodWithRSOwnerRefWithNamespaceForNode1("p10", "test", nil) // Same owners, but different images p11 := buildTestPodWithRSOwnerRefWithNamespaceForNode1("p11", "different-images", func(pod *v1.Pod) { pod.Spec.Containers[0].Image = "foo" @@ -177,7 +176,7 @@ func TestFindDuplicatePods(t *testing.T) { pods: []*v1.Pod{ buildTestPodWithRSOwnerRefWithNamespaceForNode1("p8", "test", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p9", "test", nil), - p10, + buildTestPodWithRSOwnerRefWithNamespaceForNode1("p10", "test", nil), }, nodes: []*v1.Node{node1, node2}, expectedEvictedPodCount: 1, @@ -190,7 +189,7 @@ func TestFindDuplicatePods(t *testing.T) { buildTestPodWithRSOwnerRefWithNamespaceForNode1("p3", "dev", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p8", "test", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p9", "test", nil), - p10, + buildTestPodWithRSOwnerRefWithNamespaceForNode1("p10", "test", nil), }, nodes: []*v1.Node{node1, node2}, expectedEvictedPodCount: 2, @@ -260,7 +259,7 @@ func TestFindDuplicatePods(t *testing.T) { }), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p8", "test", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p9", "test", nil), - p10, + buildTestPodWithRSOwnerRefWithNamespaceForNode1("p10", "test", nil), }, nodes: []*v1.Node{node1, node2}, expectedEvictedPodCount: 2,