From 8a0fd10315258d42a32319e356ed5a97066e66af Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Wed, 10 Dec 2025 15:53:19 +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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/framework/plugins/podlifetime/pod_lifetime_test.go b/pkg/framework/plugins/podlifetime/pod_lifetime_test.go index 6ac355e04..def94dfdf 100644 --- a/pkg/framework/plugins/podlifetime/pod_lifetime_test.go +++ b/pkg/framework/plugins/podlifetime/pod_lifetime_test.go @@ -61,9 +61,6 @@ func TestPodLifeTime(t *testing.T) { }) } - // Setup pods, one should be evicted - p6 := buildTestPodWithRSOwnerRefForNode1("p6", metav1.NewTime(time.Now().Add(-time.Second*605)), nil) - // Setup pods, zero should be evicted p7 := buildTestPodForNode1("p7", newerPodCreationTime, nil) p8 := buildTestPodForNode1("p8", metav1.NewTime(time.Now().Add(-time.Second*595)), nil) @@ -149,7 +146,7 @@ func TestPodLifeTime(t *testing.T) { }, pods: []*v1.Pod{ buildTestPodWithRSOwnerRefForNode1("p5", newerPodCreationTime, nil), - p6, + buildTestPodWithRSOwnerRefForNode1("p6", metav1.NewTime(time.Now().Add(-time.Second*605)), nil), }, nodes: []*v1.Node{buildTestNode1()}, expectedEvictedPodCount: 1,