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

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

commit 106dea63ba2f21ea43a580363445d4ad79a9c87c
Author: Joe McDonnell <joemcdonn...@cloudera.com>
AuthorDate: Tue Sep 1 09:40:16 2020 -0700

    IMPALA-10121: Generate JUnitXML for TSAN messages
    
    This adds logic in bin/jenkins/finalize.sh to check the ERROR
    log for TSAN messages (i.e. WARNING: ThreadSanitizer: ...)
    and generate a JUnitXML with the message. This happens when
    TSAN aborts Impala.
    
    Testing:
     - Ran TSAN build (which is currently failing)
    
    Change-Id: I44ea33a78482499decae0ec4c7c44513094b2f44
    Reviewed-on: http://gerrit.cloudera.org:8080/16397
    Reviewed-by: Tim Armstrong <tarmstr...@cloudera.com>
    Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
 bin/jenkins/finalize.sh | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/bin/jenkins/finalize.sh b/bin/jenkins/finalize.sh
index 2c216e7..c8ca198 100755
--- a/bin/jenkins/finalize.sh
+++ b/bin/jenkins/finalize.sh
@@ -72,14 +72,35 @@ function check_for_asan_error {
   fi
 }
 
-# Check for AddressSanitizer messages. ASAN errors can show up in ERROR logs
-# (particularly for impalad). Some backend tests generate ERROR logs.
+function check_for_tsan_error {
+  ERROR_LOG=${1}
+  if grep -q "WARNING: ThreadSanitizer:" ${ERROR_LOG} ; then
+    # Extract out the TSAN message from the log file into a temp file.
+    # Starts with WARNING: ThreadSanitizer and then ends with a line with 
several '='
+    # characters (currently 18, we match 10).
+    tmp_tsan_output=$(mktemp)
+    sed -n '/ThreadSanitizer:/,/==========/p' ${ERROR_LOG} > 
"${tmp_tsan_output}"
+    # Make each TSAN issue use its own JUnitXML file by including the log 
filename
+    # in the step.
+    base=$(basename ${ERROR_LOG})
+    "${IMPALA_HOME}"/bin/generate_junitxml.py --phase finalize \
+      --step "tsan_error_${base}" \
+      --error "Thread Sanitizer message detected in ${ERROR_LOG}" \
+      --stderr "$(cat ${tmp_tsan_output})"
+    rm "${tmp_tsan_output}"
+  fi
+}
+
+# Check for AddressSanitizer/ThreadSanitizer messages. ASAN/TSAN errors can 
show up
+# in ERROR logs (particularly for impalad). Some backend tests generate ERROR 
logs.
 for error_log in $(find $LOGS_DIR -name "*ERROR*"); do
   check_for_asan_error ${error_log}
+  check_for_tsan_error ${error_log}
 done
 # Backend tests can also generate output in logs/be_tests/LastTest.log
 if [[ -f ${LOGS_DIR}/be_tests/LastTest.log ]]; then
   check_for_asan_error ${LOGS_DIR}/be_tests/LastTest.log
+  check_for_tsan_error ${LOGS_DIR}/be_tests/LastTest.log
 fi
 
 # Check for DCHECK messages. DCHECKs translate into CHECKs, which log at FATAL 
level

Reply via email to