From 056b25dfcabbcdb2d942837828849ab797bfa1d7 Mon Sep 17 00:00:00 2001 From: Dejan Pejchev Date: Tue, 17 Oct 2023 19:18:58 +0200 Subject: [PATCH] fix: improve PodReplacementPolicy integration test case names and update deprecated methods --- test/integration/job/job_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/test/integration/job/job_test.go b/test/integration/job/job_test.go index 4638e4e5778..8fc67985f4b 100644 --- a/test/integration/job/job_test.go +++ b/test/integration/job/job_test.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "k8s.io/utils/ptr" "sort" "strconv" "strings" @@ -1757,31 +1758,31 @@ func TestJobPodReplacementPolicy(t *testing.T) { }, wantActive: int(podCount), }, - "feature flag true, delete pods, verify active and failed status and recreate once failed": { + "feature flag true, recreate failed pods, and verify active and failed counters": { podReplacementPolicyEnabled: true, failPods: true, jobSpec: &batchv1.JobSpec{ - Parallelism: pointer.Int32Ptr(podCount), - Completions: pointer.Int32Ptr(podCount), + Parallelism: ptr.To(podCount), + Completions: ptr.To(podCount), CompletionMode: &indexedCompletion, PodReplacementPolicy: podReplacementPolicy(batchv1.Failed), }, wantActive: int(podCount), wantFailed: int(podCount), - wantTerminating: pointer.Int32(0), + wantTerminating: ptr.To[int32](0), }, - "feature flag true with NonIndexedJob, delete pods, verify active and failed status and recreate once failed": { + "feature flag true with NonIndexedJob, recreate failed pods, and verify active and failed counters": { podReplacementPolicyEnabled: true, failPods: true, jobSpec: &batchv1.JobSpec{ - Parallelism: pointer.Int32Ptr(podCount), - Completions: pointer.Int32Ptr(podCount), + Parallelism: ptr.To(podCount), + Completions: ptr.To(podCount), CompletionMode: &nonIndexedCompletion, PodReplacementPolicy: podReplacementPolicy(batchv1.Failed), }, wantActive: int(podCount), wantFailed: int(podCount), - wantTerminating: pointer.Int32(0), + wantTerminating: ptr.To[int32](0), }, } for name, tc := range cases {