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 15:45:53 +01:00
parent 2648749eb8
commit 3e764eb564

View File

@@ -62,7 +62,6 @@ func TestPodLifeTime(t *testing.T) {
}
// Setup pods, zero should be evicted
p3 := buildTestPodWithRSOwnerRefForNode1("p3", newerPodCreationTime, nil)
p4 := buildTestPodWithRSOwnerRefForNode1("p4", newerPodCreationTime, nil)
// Setup pods, one should be evicted
@@ -140,7 +139,10 @@ func TestPodLifeTime(t *testing.T) {
args: &PodLifeTimeArgs{
MaxPodLifeTimeSeconds: &maxLifeTime,
},
pods: []*v1.Pod{p3, p4},
pods: []*v1.Pod{
buildTestPodWithRSOwnerRefForNode1("p3", newerPodCreationTime, nil),
p4,
},
nodes: []*v1.Node{buildTestNode1()},
expectedEvictedPodCount: 0,
},