diff --git a/ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml b/ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml index 8ad518dea18b2..ecc21897914cc 100644 --- a/ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml +++ b/ci-operator/config/redhat-chaos/lp-chaos/redhat-chaos-lp-chaos-main__ocp-4.22-ocp-chaos.yaml @@ -51,8 +51,12 @@ tests: BASE_DOMAIN: chaos.lp.devcluster.openshift.com CHAOS_TEAM_NAME: lp-chaos CONTAINER_ETCD_RECOVERY_TIME: "120" + DISRUPTION_COUNT: "6" DR__RP__CR_COMP_NAME: lp-chaos--OCP + EXPECTED_POD_COUNT: "6" + POD_LABEL: "" TELEMETRY_GROUP: ocp4.22-nightly--aws + WAIT_DURATION: "45" post: - ref: mpiit-data-router-reporter - chain: ipi-aws-post diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/custom/redhat-chaos-pod-scenarios-custom-ref.yaml b/ci-operator/step-registry/redhat-chaos/pod-scenarios/custom/redhat-chaos-pod-scenarios-custom-ref.yaml index 503493297d4e3..15074b8df4bc7 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/custom/redhat-chaos-pod-scenarios-custom-ref.yaml +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/custom/redhat-chaos-pod-scenarios-custom-ref.yaml @@ -5,6 +5,7 @@ ref: name: prow-scripts tag: latest commands: redhat-chaos-pod-scenarios-custom-commands.sh + grace_period: 10m credentials: - namespace: test-credentials name: cluster-secrets-aws-chaos diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-commands.sh b/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-commands.sh index ba9bd15ebbb88..43bf0dca224f9 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-commands.sh +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-commands.sh @@ -56,24 +56,31 @@ else export HEALTH_CHECK_URL=https://$console_url echo "Using console health check URL: $HEALTH_CHECK_URL" fi -set -o nounset -set -o pipefail -set -x -./pod-scenarios/prow_run.sh -rc=$? -echo "Done running the test!" -oc get pods -n $TARGET_NAMESPACE -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.phase}{"\t"}{.status.conditions[?(@.type=="Ready")].lastTransitionTime}{"\t"}{.status.startTime}{"\t"}{.metadata.creationTimestamp}{"\n"}{end}' - -cat /tmp/*.log -if [[ $TELEMETRY_EVENTS_BACKUP == "True" ]]; then - cp /tmp/events.json ${ARTIFACT_DIR}/events.json -fi +collect_artifacts() { + local rc=$? + # Disable errexit here: prow_run.sh may have exited non-zero and triggered + # this trap, so none of the collection commands below should abort the trap. + set +o errexit + echo "Done running the test!" + oc get pods -n "$TARGET_NAMESPACE" -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.phase}{"\t"}{.status.conditions[?(@.type=="Ready")].lastTransitionTime}{"\t"}{.status.startTime}{"\t"}{.metadata.creationTimestamp}{"\n"}{end}' + cat /tmp/*.log 2>/dev/null + if [[ "${TELEMETRY_EVENTS_BACKUP:-}" == "True" && -f /tmp/events.json ]]; then + cp /tmp/events.json "${ARTIFACT_DIR}/events.json" + fi + if [[ -f /tmp/report.out.pdf ]]; then + cp /tmp/report.out.pdf "${ARTIFACT_DIR}/kraken.report.pdf" + fi + echo "Return code: $rc" + exit "$rc" +} +# errexit will abort the script the instant prow_run.sh fails, before any +# artifact-collection commands can run. A trap on EXIT fires regardless of +# how the shell exits, so it's used here to guarantee artifacts (including +# the PDF report) are always copied to ARTIFACT_DIR. +trap collect_artifacts EXIT -if [[ -f /tmp/report.out.pdf ]]; then - cp /tmp/report.out.pdf ${ARTIFACT_DIR}/kraken.report.pdf -fi +set -euxo pipefail; shopt -s inherit_errexit -echo "Return code: $rc" -exit $rc +./pod-scenarios/prow_run.sh \ No newline at end of file diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml b/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml index bf80e94351fce..b19545be1851a 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/etcd-disruption/redhat-chaos-pod-scenarios-etcd-disruption-ref.yaml @@ -5,6 +5,7 @@ ref: name: prow-scripts tag: latest commands: redhat-chaos-pod-scenarios-etcd-disruption-commands.sh + grace_period: 10m credentials: - namespace: test-credentials name: cluster-secrets-aws-chaos diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/kube-apiserver-disruption/redhat-chaos-pod-scenarios-kube-apiserver-disruption-ref.yaml b/ci-operator/step-registry/redhat-chaos/pod-scenarios/kube-apiserver-disruption/redhat-chaos-pod-scenarios-kube-apiserver-disruption-ref.yaml index 32ca54c2231e2..40d5d4bc6d52c 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/kube-apiserver-disruption/redhat-chaos-pod-scenarios-kube-apiserver-disruption-ref.yaml +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/kube-apiserver-disruption/redhat-chaos-pod-scenarios-kube-apiserver-disruption-ref.yaml @@ -5,6 +5,7 @@ ref: name: prow-scripts tag: latest commands: redhat-chaos-pod-scenarios-kube-apiserver-disruption-commands.sh + grace_period: 10m credentials: - namespace: test-credentials name: cluster-secrets-aws-chaos diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-cp-disruption/redhat-chaos-pod-scenarios-ovn-cp-disruption-ref.yaml b/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-cp-disruption/redhat-chaos-pod-scenarios-ovn-cp-disruption-ref.yaml index 0163207b04039..d80d531018586 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-cp-disruption/redhat-chaos-pod-scenarios-ovn-cp-disruption-ref.yaml +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-cp-disruption/redhat-chaos-pod-scenarios-ovn-cp-disruption-ref.yaml @@ -5,6 +5,7 @@ ref: name: prow-scripts tag: latest commands: redhat-chaos-pod-scenarios-ovn-cp-disruption-commands.sh + grace_period: 10m credentials: - namespace: test-credentials name: cluster-secrets-aws-chaos diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-disruption/redhat-chaos-pod-scenarios-ovn-disruption-ref.yaml b/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-disruption/redhat-chaos-pod-scenarios-ovn-disruption-ref.yaml index c3defa237e458..f3e779f7722f1 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-disruption/redhat-chaos-pod-scenarios-ovn-disruption-ref.yaml +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/ovn-disruption/redhat-chaos-pod-scenarios-ovn-disruption-ref.yaml @@ -5,6 +5,7 @@ ref: name: prow-scripts tag: latest commands: redhat-chaos-pod-scenarios-ovn-disruption-commands.sh + grace_period: 10m credentials: - namespace: test-credentials name: cluster-secrets-aws-chaos diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/prometheus-disruption/redhat-chaos-pod-scenarios-prometheus-disruption-ref.yaml b/ci-operator/step-registry/redhat-chaos/pod-scenarios/prometheus-disruption/redhat-chaos-pod-scenarios-prometheus-disruption-ref.yaml index 7490ea7033b8f..f2754499f5049 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/prometheus-disruption/redhat-chaos-pod-scenarios-prometheus-disruption-ref.yaml +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/prometheus-disruption/redhat-chaos-pod-scenarios-prometheus-disruption-ref.yaml @@ -5,6 +5,7 @@ ref: name: prow-scripts tag: latest commands: redhat-chaos-pod-scenarios-prometheus-disruption-commands.sh + grace_period: 10m credentials: - namespace: test-credentials name: cluster-secrets-aws-chaos diff --git a/ci-operator/step-registry/redhat-chaos/pod-scenarios/random-system-pods/redhat-chaos-pod-scenarios-random-system-pods-ref.yaml b/ci-operator/step-registry/redhat-chaos/pod-scenarios/random-system-pods/redhat-chaos-pod-scenarios-random-system-pods-ref.yaml index fbcb48bc4650e..311edf5814b95 100644 --- a/ci-operator/step-registry/redhat-chaos/pod-scenarios/random-system-pods/redhat-chaos-pod-scenarios-random-system-pods-ref.yaml +++ b/ci-operator/step-registry/redhat-chaos/pod-scenarios/random-system-pods/redhat-chaos-pod-scenarios-random-system-pods-ref.yaml @@ -5,6 +5,7 @@ ref: name: prow-scripts tag: latest commands: redhat-chaos-pod-scenarios-random-system-pods-commands.sh + grace_period: 10m credentials: - namespace: test-credentials name: cluster-secrets-aws-chaos