This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d76bc0715 HDDS-9509. Count total number of failures in 
flaky-test-check (#5473)
4d76bc0715 is described below

commit 4d76bc0715a289fff628adacd73f04198cefcc26
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Oct 25 08:48:19 2023 +0200

    HDDS-9509. Count total number of failures in flaky-test-check (#5473)
---
 .github/workflows/intermittent-test-check.yml | 22 ++++++++++++++++++++--
 hadoop-ozone/dev-support/checks/junit.sh      |  7 ++++++-
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/intermittent-test-check.yml 
b/.github/workflows/intermittent-test-check.yml
index ffec972694..191c706293 100644
--- a/.github/workflows/intermittent-test-check.yml
+++ b/.github/workflows/intermittent-test-check.yml
@@ -46,7 +46,7 @@ env:
   TEST_METHOD: ${{ github.event.inputs.test-name }}
   ITERATIONS: ${{ github.event.inputs.iterations }}
   FAIL_FAST: ${{ github.event.inputs.fail-fast }}
-run-name: ${{ github.event_name == 'workflow_dispatch' && 
format('{0}#{1}[{2}]', inputs.test-class, inputs.test-name, inputs.ref) || '' }}
+run-name: ${{ github.event_name == 'workflow_dispatch' && 
format('{0}#{1}[{2}]-{3}x{4}', inputs.test-class, inputs.test-name, inputs.ref, 
inputs.splits, inputs.iterations) || '' }}
 jobs:
   prepare-job:
     runs-on: ubuntu-20.04
@@ -137,7 +137,7 @@ jobs:
           CHECK: ${{ needs.prepare-job.outputs.test_type }}
       - name: Summary of failures
         run: hadoop-ozone/dev-support/checks/_summary.sh target/${{ 
needs.prepare-job.outputs.test_type }}/summary.txt
-        if: always()
+        if: ${{ !cancelled() }}
       - name: Archive build results
         uses: actions/upload-artifact@v3
         if: always()
@@ -150,3 +150,21 @@ jobs:
           rm -rf ~/.m2/repository/org/apache/ozone/hdds*
           rm -rf ~/.m2/repository/org/apache/ozone/ozone*
         if: always()
+  count-failures:
+    if: ${{ always() }}
+    needs: run-test
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Download build results
+        uses: actions/download-artifact@v3
+      - name: Count failures
+        run: |
+          failures=$(find . -name 'summary.txt' | grep -v 'iteration' | xargs 
grep -v 'exit code: 0' | wc -l)
+          echo "Total failures: $failures"
+          if [[ $failures -gt 0 ]]; then
+            echo ""
+            echo "Failed runs:"
+            grep 'exit code: 1' */summary.txt | grep -o 'split.*teration 
[0-9]*' | sed -e 's/.summary.txt:/ /' -e 's/-/ /' | sort -g -k2 -k4
+            echo ""
+            exit 1
+          fi
diff --git a/hadoop-ozone/dev-support/checks/junit.sh 
b/hadoop-ozone/dev-support/checks/junit.sh
index 2b0865f1c2..7d66e7b7f2 100755
--- a/hadoop-ozone/dev-support/checks/junit.sh
+++ b/hadoop-ozone/dev-support/checks/junit.sh
@@ -20,6 +20,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 
&& pwd )"
 cd "$DIR/../../.." || exit 1
 
 : ${CHECK:="unit"}
+: ${FAIL_FAST:="false"}
 : ${ITERATIONS:="1"}
 : ${OZONE_WITH_COVERAGE:="false"}
 : ${OZONE_REPO_CACHED:="false"}
@@ -36,7 +37,7 @@ if [[ "${OZONE_WITH_COVERAGE}" != "true" ]]; then
   MAVEN_OPTIONS="${MAVEN_OPTIONS} -Djacoco.skip"
 fi
 
-if [[ "${FAIL_FAST:-}" == "true" ]]; then
+if [[ "${FAIL_FAST}" == "true" ]]; then
   MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-fast 
-Dsurefire.skipAfterFailureCount=1"
 else
   MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-at-end"
@@ -77,6 +78,10 @@ for i in $(seq 1 ${ITERATIONS}); do
   if [[ ${rc} == 0 ]]; then
     rc=${irc}
   fi
+
+  if [[ ${rc} != 0 ]] && [[ "${FAIL_FAST}" == "true" ]]; then
+    break
+  fi
 done
 
 if [[ "${OZONE_WITH_COVERAGE}" == "true" ]]; then


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to