From cab310e55c7cac53d20f052c69b6902cd043506a Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Wed, 10 Dec 2025 16:05:30 +0100 Subject: [PATCH] refactor(TestPodLifeTime): inline pod creation in each unit test to avoid accidental pod spec updates --- pkg/framework/plugins/podlifetime/pod_lifetime_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/framework/plugins/podlifetime/pod_lifetime_test.go b/pkg/framework/plugins/podlifetime/pod_lifetime_test.go index 65d70f811..c13ec4cfe 100644 --- a/pkg/framework/plugins/podlifetime/pod_lifetime_test.go +++ b/pkg/framework/plugins/podlifetime/pod_lifetime_test.go @@ -70,10 +70,6 @@ func TestPodLifeTime(t *testing.T) { }) } - p15 := buildTestPodWithRSOwnerRefForNode1("p15", olderPodCreationTime, func(pod *v1.Pod) { - pod.DeletionTimestamp = &metav1.Time{} - }) - p16 := buildTestPodWithRSOwnerRefForNode1("p16", olderPodCreationTime, func(pod *v1.Pod) { pod.Status.Phase = v1.PodUnknown }) @@ -270,7 +266,9 @@ func TestPodLifeTime(t *testing.T) { buildTestPodWithRSOwnerRefForNode1("p14", olderPodCreationTime, func(pod *v1.Pod) { pod.DeletionTimestamp = &metav1.Time{} }), - p15, + buildTestPodWithRSOwnerRefForNode1("p15", olderPodCreationTime, func(pod *v1.Pod) { + pod.DeletionTimestamp = &metav1.Time{} + }), }, nodes: []*v1.Node{buildTestNode1()}, expectedEvictedPodCount: 0,