From 01b1403454fbcfda6adc513e2c9f1258029ef8a0 Mon Sep 17 00:00:00 2001 From: Patrick Gartung Date: Sat, 7 Sep 2024 15:39:28 +0200 Subject: [PATCH] Check for Memory Report: before reporting step --- pr_testing/run-pr-comparisons | 7 ++++++- run-ib-pr-matrix.sh | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pr_testing/run-pr-comparisons b/pr_testing/run-pr-comparisons index 5817235707af..145b389e1aa3 100755 --- a/pr_testing/run-pr-comparisons +++ b/pr_testing/run-pr-comparisons @@ -402,7 +402,12 @@ for WF in ${WORKFLOWS_TO_COMPARE//,/ }; do $CMS_BOT_DIR/comparisons/compare-maxmem.py $WORKSPACE/data/PR-${PR_NUM}/$WF_DIR/maxmem_profile_${WF_NUMBER}.txt $WORKSPACE/data/$COMPARISON_RELEASE/$WF_DIR/maxmem_profile_${WF_NUMBER}.txt > $OUTPUT_DIR/${WF_NUMBER}.txt 2> $OUTPUT_DIR/${WF_NUMBER}.err || true fi done -grep -q "exceeds threshold" $OUTPUT_DIR/*.err 2>/dev/null || echo "MAXMEM_COMPARISON${TEST_FLAVOR_STR};OK,max memory used ${UC_TEST_FLAVOR} comparison,See results,/SDT/jenkins-artifacts/${OUTPUT_DIR}/" >> ${RESULTS_FILE} +if grep "exceeds threshold" $OUTPUT_DIR/*.err 2>/dev/null then + echo "MAXMEM_COMPARISON${TEST_FLAVOR_STR};OK,max memory used ${UC_TEST_FLAVOR} comparison,See results,/SDT/jenkins-artifacts/${OUTPUT_DIR}/" >> ${RESULTS_FILE} +else + echo "MAXMEM_COMPARISON${TEST_FLAVOR_STR};OK,max memory used ${UC_TEST_FLAVOR} comparison,See results,/SDT/jenkins-artifacts/${OUTPUT_DIR}/" >> ${RESULTS_FILE} +fi + # ---------------------------------------------------------------------------- # Alternative Comparison # ---------------------------------------------------------------------------- diff --git a/run-ib-pr-matrix.sh b/run-ib-pr-matrix.sh index d9fd126d731e..6fd24d05107d 100755 --- a/run-ib-pr-matrix.sh +++ b/run-ib-pr-matrix.sh @@ -88,8 +88,10 @@ pushd "$WORKSPACE/matrix-results" memFile=maxmem_profile_$(echo $WF | cut -d_ -f1).txt pushd $WF for log in $(ls step*.log);do - echo ${log} | cut -d_ -f1 >> ${memFile} - grep "Memory Report: " $log | tail -5 >> ${memFile} + if grep -q "Memory Report: " $log 2>/dev/null; then + echo ${log} | cut -d_ -f1 >> ${memFile} + grep "Memory Report: " $log | tail -5 >> ${memFile} + fi done popd done