1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

refactor(TestPodLifeTime): inline pod creation in each unit test to avoid accidental pod spec updates

This commit is contained in:
Jan Chaloupka
2025-12-10 16:05:30 +01:00
parent 822a1d4c40
commit cab310e55c

View File

@@ -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,