From 044f75dceca8bc21908e83972b6d750c9625841b Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 14 Dec 2025 16:10:49 +0100 Subject: [PATCH] refactor(TestFindDuplicatePods): inline node6 creation --- .../plugins/removeduplicates/removeduplicates_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go index 3eef2a124..60ec327a0 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go @@ -79,7 +79,6 @@ func buildTestPodWithRSOwnerRefWithNamespaceForNode1(name, namespace string, app func TestFindDuplicatePods(t *testing.T) { // first setup pods - node6 := test.BuildTestNode(nodeName6, 200, 200, 10, nil) // Three Pods in the "dev" Namespace, bound to same ReplicaSet. 2 should be evicted. // A DaemonSet. @@ -366,13 +365,13 @@ func TestFindDuplicatePods(t *testing.T) { buildTestPodWithRSOwnerRefWithNamespaceForNode1("p1", "dev", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p2", "dev", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p3", "dev", nil), - test.BuildTestPod("CPU-eater", 150, 150, node6.Name, func(pod *v1.Pod) { + test.BuildTestPod("CPU-eater", 150, 150, nodeName6, func(pod *v1.Pod) { pod.Namespace = "test" }), }, nodes: []*v1.Node{ buildTestNode(nodeName1, nil), - node6, + test.BuildTestNode(nodeName6, 200, 200, 10, nil), }, expectedEvictedPodCount: 0, nodefit: true, @@ -383,13 +382,13 @@ func TestFindDuplicatePods(t *testing.T) { buildTestPodWithRSOwnerRefWithNamespaceForNode1("p1", "dev", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p2", "dev", nil), buildTestPodWithRSOwnerRefWithNamespaceForNode1("p3", "dev", nil), - test.BuildTestPod("CPU-saver", 100, 150, node6.Name, func(pod *v1.Pod) { + test.BuildTestPod("CPU-saver", 100, 150, nodeName6, func(pod *v1.Pod) { pod.Namespace = "test" }), }, nodes: []*v1.Node{ buildTestNode(nodeName1, nil), - node6, + test.BuildTestNode(nodeName6, 200, 200, 10, nil), }, expectedEvictedPodCount: 1, nodefit: true,