@@ -57,6 +57,7 @@ const (
57
57
58
58
var (
59
59
startTime = time .Now ()
60
+ completionTime = time .Now ().Add (time .Second )
60
61
batchJobKey = types.NamespacedName {Name : batchJobName , Namespace : namespace }
61
62
observationLogAvailable = & api_pb.GetObservationLogReply {
62
63
ObservationLog : & api_pb.ObservationLog {
@@ -218,7 +219,8 @@ func TestReconcileBatchJob(t *testing.T) {
218
219
Reason : batchJobCompleteReason ,
219
220
},
220
221
},
221
- StartTime : & metav1.Time {Time : startTime },
222
+ StartTime : & metav1.Time {Time : startTime },
223
+ CompletionTime : & metav1.Time {Time : completionTime },
222
224
}
223
225
g .Expect (c .Status ().Update (ctx , batchJob )).NotTo (gomega .HaveOccurred ())
224
226
@@ -465,6 +467,17 @@ func newFakeTrialBatchJob(mcType commonv1beta1.CollectorKind, trialName string)
465
467
Namespace : namespace ,
466
468
},
467
469
Spec : batchv1.JobSpec {
470
+ CompletionMode : ptr .To (batchv1 .IndexedCompletion ),
471
+ Completions : ptr .To (int32 (1 )),
472
+ Parallelism : ptr .To (int32 (1 )),
473
+ SuccessPolicy : & batchv1.SuccessPolicy {
474
+ Rules : []batchv1.SuccessPolicyRule {
475
+ {
476
+ SucceededIndexes : ptr .To ("0" ),
477
+ SucceededCount : ptr .To (int32 (1 )),
478
+ },
479
+ },
480
+ },
468
481
Template : corev1.PodTemplateSpec {
469
482
Spec : corev1.PodSpec {
470
483
Containers : []corev1.Container {
0 commit comments