-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control-service: fix oom tests (#2028)
# Why In this PR I fix a very unstable oom test. The test is very unstable for a number of reasons. 1. sometime the job actually succeeds, it seems to be able to compelte with in the memory limits after a number of retries. We can put the memory requirement any lower to ensure an error because 6mi is the lower limit supported by k8s. 2. on of the assertions we were making is that the logs are there. However often if the jobs is killed at the very start there are no logs. # What I fix it by using a cronjob template which doesn't let the job restart. This means if it fails once it will report as failed. # How has this been tested? integration tests. --------- Signed-off-by: murphp15 <[email protected]> Co-authored-by: github-actions <> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
66c6b34
commit 61f1192
Showing
4 changed files
with
72 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...jects/pipelines_control_service/src/integration-test/resources/fast_failing_cron_job.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
apiVersion: batch/v1beta1 | ||
kind: CronJob | ||
metadata: | ||
annotations: # merged with additional annotations from TPCS | ||
name: cronjob-template-name # overridden by TPCS | ||
spec: | ||
concurrencyPolicy: Forbid | ||
failedJobsHistoryLimit: 2 | ||
schedule: "*/10 * * * *" # overridden by TPCS | ||
startingDeadlineSeconds: 1800 | ||
successfulJobsHistoryLimit: 1 | ||
suspend: false # overridden by TPCS | ||
jobTemplate: | ||
metadata: | ||
annotations: # merged with additional annotations from TPCS | ||
labels: # merged with additional labels from TPCS | ||
spec: | ||
activeDeadlineSeconds: 43200 | ||
backoffLimit: 3 | ||
template: | ||
metadata: | ||
labels: # merged with additional labels from TPCS | ||
spec: | ||
containers: # overridden by TPCS | ||
- command: | ||
- /bin/sh | ||
- -c | ||
- date; echo '************** Cronjob Template ******************' | ||
name: cronjob-template-container-name | ||
image: busybox | ||
imagePullPolicy: IfNotPresent | ||
restartPolicy: Never | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
fsGroup: 1000 | ||
automountServiceAccountToken: false | ||
ttlSecondsAfterFinished: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters