From 9f2d22c1f7d03e1a0c122b36de93ae7d63a91cdf Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Mon, 15 Dec 2025 13:53:19 +0100 Subject: [PATCH] refactor(TestPodAntiAffinity): inline p5 --- .../pod_antiaffinity_test.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go index 40f702360..64b3c4f5f 100644 --- a/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go +++ b/pkg/framework/plugins/removepodsviolatinginterpodantiaffinity/pod_antiaffinity_test.go @@ -117,12 +117,6 @@ func buildTestPodNonEvictableForNode1() *v1.Pod { func TestPodAntiAffinity(t *testing.T) { - p5 := buildTestPodForNode1("p5", func(pod *v1.Pod) { - test.SetNormalOwnerRef(pod) - setLabelsFooBar(pod) - setPodAntiAffinityFoo1Bar1(pod) - test.SetPodPriority(pod, 100) - }) p6 := buildTestPodForNode1("p6", func(pod *v1.Pod) { test.SetNormalOwnerRef(pod) setLabelsFooBar(pod) @@ -224,7 +218,14 @@ func TestPodAntiAffinity(t *testing.T) { }, { description: "Evict only 1 pod after sorting", - pods: []*v1.Pod{p5, p6, p7}, + pods: []*v1.Pod{ + buildTestPodForNode1("p5", func(pod *v1.Pod) { + test.SetNormalOwnerRef(pod) + setLabelsFooBar(pod) + setPodAntiAffinityFoo1Bar1(pod) + test.SetPodPriority(pod, 100) + }), + p6, p7}, nodes: []*v1.Node{ buildTestNode1(), },