mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 13:29:11 +01:00
refactor(TestPodLifeTime): inline pod creation in each unit test to avoid accidental pod spec updates
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user