revert changes to TestMetricsOnSuccesses for job pods creation total metric

This commit is contained in:
Dejan Pejchev 2023-10-24 19:41:14 +02:00
parent 88c0a8be1b
commit 9e2821d585
No known key found for this signature in database
GPG Key ID: 8A900F09C964845E

View File

@ -82,7 +82,6 @@ func TestMetricsOnSuccesses(t *testing.T) {
job *batchv1.Job
wantJobFinishedNumMetric metricLabelsWithValue
wantJobPodsFinishedMetric metricLabelsWithValue
wantJobPodsCreatedMetric metricLabelsWithValue
}{
"non-indexed job": {
job: &batchv1.Job{
@ -100,10 +99,6 @@ func TestMetricsOnSuccesses(t *testing.T) {
Labels: []string{"NonIndexed", "succeeded"},
Value: 2,
},
wantJobPodsCreatedMetric: metricLabelsWithValue{
Labels: []string{"new", "succeeded"},
Value: 2,
},
},
"indexed job": {
job: &batchv1.Job{
@ -121,10 +116,6 @@ func TestMetricsOnSuccesses(t *testing.T) {
Labels: []string{"Indexed", "succeeded"},
Value: 2,
},
wantJobPodsCreatedMetric: metricLabelsWithValue{
Labels: []string{"new", "succeeded"},
Value: 2,
},
},
}
job_index := 0 // job index to avoid collisions between job names created by different test cases
@ -151,7 +142,6 @@ func TestMetricsOnSuccesses(t *testing.T) {
// verify metric values after the job is finished
validateCounterMetric(ctx, t, metrics.JobFinishedNum, tc.wantJobFinishedNumMetric)
validateCounterMetric(ctx, t, metrics.JobPodsFinished, tc.wantJobPodsFinishedMetric)
validateCounterMetric(ctx, t, metrics.JobPodsCreationTotal, tc.wantJobPodsCreatedMetric)
validateTerminatedPodsTrackingFinalizerMetric(ctx, t, int(*jobObj.Spec.Parallelism))
})
}