From 59bae24741f7c61b8d268c4d749077598b20ba05 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 7 Mar 2025 14:31:49 +0100 Subject: [PATCH 1/3] HDDS-12500. Do not skip JUnit tests in post-commit runs --- hadoop-ozone/dev-support/checks/_post_process.sh | 8 ++++---- hadoop-ozone/dev-support/checks/junit.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hadoop-ozone/dev-support/checks/_post_process.sh b/hadoop-ozone/dev-support/checks/_post_process.sh index ac05e2c00043..7501050f34f8 100644 --- a/hadoop-ozone/dev-support/checks/_post_process.sh +++ b/hadoop-ozone/dev-support/checks/_post_process.sh @@ -26,13 +26,13 @@ # - $REPORT_FILE should be defined # - Maven output should be saved in $REPORT_DIR/output.log -# script failed, but report file is empty (does not reflect failure) -if [[ ${rc} -ne 0 ]] && [[ ! -s "${REPORT_FILE}" ]]; then - # do we know what to look for? +if [[ ! -s "${REPORT_FILE}" ]]; then + # check if there are errors in the log if [[ -n "${ERROR_PATTERN:-}" ]]; then grep -m25 "${ERROR_PATTERN}" "${REPORT_DIR}/output.log" > "${REPORT_FILE}" fi - if [[ ! -s "${REPORT_FILE}" ]]; then + # script failed, but report file is empty (does not reflect failure) + if [[ ${rc} -ne 0 ]] && [[ ! -s "${REPORT_FILE}" ]]; then echo "Unknown failure, check output.log" > "${REPORT_FILE}" fi fi diff --git a/hadoop-ozone/dev-support/checks/junit.sh b/hadoop-ozone/dev-support/checks/junit.sh index 46f1fd77f2b1..d737ad9abdcf 100755 --- a/hadoop-ozone/dev-support/checks/junit.sh +++ b/hadoop-ozone/dev-support/checks/junit.sh @@ -40,7 +40,7 @@ fi if [[ "${FAIL_FAST}" == "true" ]]; then MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-fast -Dsurefire.skipAfterFailureCount=1" else - MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-at-end" + MAVEN_OPTIONS="${MAVEN_OPTIONS} --fail-never" fi # apply module access args (for Java 9+) From 45b0b21d2cea04918ba01c1b5259b1a33153bdba Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 7 Mar 2025 14:32:18 +0100 Subject: [PATCH 2/3] mvn clean before tests --- hadoop-ozone/dev-support/checks/junit.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-ozone/dev-support/checks/junit.sh b/hadoop-ozone/dev-support/checks/junit.sh index d737ad9abdcf..cf1dadc32419 100755 --- a/hadoop-ozone/dev-support/checks/junit.sh +++ b/hadoop-ozone/dev-support/checks/junit.sh @@ -50,8 +50,10 @@ if [[ -f hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh ]]; then ozone_java_setup fi +mvn ${MAVEN_OPTIONS} clean + if [[ ${ITERATIONS} -gt 1 ]] && [[ ${OZONE_REPO_CACHED} == "false" ]]; then - mvn ${MAVEN_OPTIONS} -DskipTests clean install + mvn ${MAVEN_OPTIONS} -DskipTests install fi REPORT_DIR=${OUTPUT_DIR:-"$DIR/../../../target/${CHECK}"} From b5c9cb5503c540bc5babe7e6932c8474ac0e4c2b Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 7 Mar 2025 16:29:02 +0100 Subject: [PATCH 3/3] allow individual errors (for flaky check) --- hadoop-ozone/dev-support/checks/junit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-ozone/dev-support/checks/junit.sh b/hadoop-ozone/dev-support/checks/junit.sh index cf1dadc32419..7c25293c5d74 100755 --- a/hadoop-ozone/dev-support/checks/junit.sh +++ b/hadoop-ozone/dev-support/checks/junit.sh @@ -107,5 +107,5 @@ if [[ "${OZONE_WITH_COVERAGE}" == "true" ]]; then mvn -B -N jacoco:merge -Djacoco.destFile=$REPORT_DIR/jacoco-combined.exec -Dscan=false fi -ERROR_PATTERN="\[ERROR\]" +ERROR_PATTERN="BUILD FAILURE" source "${DIR}/_post_process.sh"