From 96171413ba8679b0a51b87b3d1c67719a0df3fa5 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 14 Dec 2025 12:26:08 +0100 Subject: [PATCH] refactor(TestFindDuplicatePods): have a pod fully created through BuildTestPod without any edits --- .../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 28db8a66a..5f9186e38 100644 --- a/pkg/framework/plugins/removeduplicates/removeduplicates_test.go +++ b/pkg/framework/plugins/removeduplicates/removeduplicates_test.go @@ -77,8 +77,10 @@ func TestFindDuplicatePods(t *testing.T) { pod.Namespace = "dev" pod.ObjectMeta.OwnerReferences = ownerRef1 }) - p3 := test.BuildTestPod("p3", 100, 0, node1.Name, nil) - p3.Namespace = "dev" + p3 := test.BuildTestPod("p3", 100, 0, node1.Name, func(pod *v1.Pod) { + pod.Namespace = "dev" + pod.ObjectMeta.OwnerReferences = ownerRef1 + }) p4 := test.BuildTestPod("p4", 100, 0, node1.Name, nil) p5 := test.BuildTestPod("p5", 100, 0, node1.Name, nil) p6 := test.BuildTestPod("p6", 100, 0, node1.Name, nil) @@ -117,9 +119,6 @@ func TestFindDuplicatePods(t *testing.T) { // ### Evictable Pods ### - // Three Pods in the "default" Namespace, bound to same ReplicaSet. 2 should be evicted. - p3.ObjectMeta.OwnerReferences = ownerRef1 - // Three Pods in the "test" Namespace, bound to same ReplicaSet. 2 should be evicted. ownerRef2 := test.GetReplicaSetOwnerRefList() p8.ObjectMeta.OwnerReferences = ownerRef2