Skip to content

Commit 8aa1d33

Browse files
authored
Merge pull request kubernetes#131102 from esotsal/debug_131067
[FG:InPlacePodVerticalScaling] Clean code resize test
2 parents 42bd939 + d6b45bc commit 8aa1d33

File tree

1 file changed

+13
-5
lines changed
  • test/e2e/common/node/framework/podresize

1 file changed

+13
-5
lines changed

test/e2e/common/node/framework/podresize/resize.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,19 @@ func VerifyPodContainersCgroupValues(ctx context.Context, f *framework.Framework
345345
}
346346

347347
if expectedMemLimitString != "0" {
348-
errs = append(errs, e2epod.VerifyCgroupValue(f, pod, ci.Name, cgroupMemLimit, expectedMemLimitString))
348+
if err := e2epod.VerifyCgroupValue(f, pod, ci.Name, cgroupMemLimit, expectedMemLimitString); err != nil {
349+
errs = append(errs, fmt.Errorf("failed to verify memory limit cgroup value: %w", err))
350+
}
351+
}
352+
353+
if err := e2epod.VerifyCgroupValue(f, pod, ci.Name, cgroupCPULimit, expectedCPULimits...); err != nil {
354+
errs = append(errs, fmt.Errorf("failed to verify cpu limit cgroup value: %w", err))
349355
}
350-
errs = append(errs, e2epod.VerifyCgroupValue(f, pod, ci.Name, cgroupCPULimit, expectedCPULimits...))
351-
errs = append(errs, e2epod.VerifyCgroupValue(f, pod, ci.Name, cgroupCPURequest, strconv.FormatInt(expectedCPUShares, 10)))
356+
357+
if err := e2epod.VerifyCgroupValue(f, pod, ci.Name, cgroupCPURequest, strconv.FormatInt(expectedCPUShares, 10)); err != nil {
358+
errs = append(errs, fmt.Errorf("failed to verify cpu request cgroup value: %w", err))
359+
}
360+
352361
// TODO(vinaykul,InPlacePodVerticalScaling): Verify oom_score_adj when runc adds support for updating it
353362
// See https://github.com/opencontainers/runc/pull/4669
354363
}
@@ -384,8 +393,7 @@ func verifyContainerRestarts(f *framework.Framework, pod *v1.Pod, gotStatuses []
384393
if gotStatus.RestartCount != wantStatuses[i].RestartCount {
385394
errs = append(errs, fmt.Errorf("unexpected number of restarts for container %s: got %d, want %d", gotStatus.Name, gotStatus.RestartCount, wantStatuses[i].RestartCount))
386395
} else if gotStatus.RestartCount > 0 {
387-
err := verifyOomScoreAdj(f, pod, gotStatus.Name)
388-
if err != nil {
396+
if err := verifyOomScoreAdj(f, pod, gotStatus.Name); err != nil {
389397
errs = append(errs, err)
390398
}
391399
}

0 commit comments

Comments
 (0)