From: Vsevolod Stakhov Date: Fri, 17 Oct 2025 20:52:22 +0000 (+0100) Subject: [Test] Fix results filename and ASAN for multiple processes X-Git-Tag: 3.14.0~67^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2aa6dd3cb3af76ae2b054f60ecbbf4f71912dcf;p=thirdparty%2Frspamd.git [Test] Fix results filename and ASAN for multiple processes - Rename scan_results.json to results.json for workflow - Add log_suffix=.%p to ASAN_OPTIONS for per-process logs - Add log_exe_name=1 and log_threads=1 for better debugging --- diff --git a/test/integration/docker-compose.yml b/test/integration/docker-compose.yml index 63a4a064e9..f82272825e 100644 --- a/test/integration/docker-compose.yml +++ b/test/integration/docker-compose.yml @@ -40,9 +40,9 @@ services: environment: - RSPAMD_REDIS_ADDR=redis - RSPAMD_REDIS_PORT=6379 - # AddressSanitizer configuration - - ASAN_OPTIONS=detect_leaks=1:halt_on_error=0:abort_on_error=0:print_stats=1:log_path=/data/asan.log - - LSAN_OPTIONS=suppressions=/etc/rspamd/lsan.supp:print_suppressions=0 + # AddressSanitizer configuration for multiple processes + - ASAN_OPTIONS=detect_leaks=1:halt_on_error=0:abort_on_error=0:print_stats=1:log_path=/data/asan.log:log_suffix=.%p:log_exe_name=1 + - LSAN_OPTIONS=suppressions=/etc/rspamd/lsan.supp:print_suppressions=0:log_threads=1 healthcheck: test: [ "CMD-SHELL", "pidof rspamd > /dev/null || exit 1" ] interval: 10s diff --git a/test/integration/scripts/integration-test.sh b/test/integration/scripts/integration-test.sh index 91a644c0ab..c9c01606c5 100755 --- a/test/integration/scripts/integration-test.sh +++ b/test/integration/scripts/integration-test.sh @@ -157,7 +157,7 @@ echo "Scanning $TOTAL_EMAILS emails (parallelism: $PARALLEL)..." # Scan the same files we used for training (from shuffled list) # Use xargs with -a to read from file and avoid argument list too long xargs -a "$DATA_DIR/shuffled_files.txt" rspamc -h "$RSPAMD_HOST:$CONTROLLER_PORT" \ - -P "$PASSWORD" -n "$PARALLEL" -j > "$DATA_DIR/scan_results.json" 2>&1 + -P "$PASSWORD" -n "$PARALLEL" -j > "$DATA_DIR/results.json" 2>&1 echo "✓ Scanning complete" echo "" @@ -171,16 +171,16 @@ echo "" # Count detections using grep and jq (or grep if jq not available) if command -v jq &> /dev/null; then # Use jq for JSON parsing - TOTAL=$(jq 'length' "$DATA_DIR/scan_results.json") - FUZZY_COUNT=$(jq '[.[] | select(.symbols | keys[] | startswith("FUZZY_"))] | length' "$DATA_DIR/scan_results.json") - BAYES_SPAM_COUNT=$(jq '[.[] | select(.symbols.BAYES_SPAM)] | length' "$DATA_DIR/scan_results.json") - BAYES_HAM_COUNT=$(jq '[.[] | select(.symbols.BAYES_HAM)] | length' "$DATA_DIR/scan_results.json") + TOTAL=$(jq 'length' "$DATA_DIR/results.json") + FUZZY_COUNT=$(jq '[.[] | select(.symbols | keys[] | startswith("FUZZY_"))] | length' "$DATA_DIR/results.json") + BAYES_SPAM_COUNT=$(jq '[.[] | select(.symbols.BAYES_SPAM)] | length' "$DATA_DIR/results.json") + BAYES_HAM_COUNT=$(jq '[.[] | select(.symbols.BAYES_HAM)] | length' "$DATA_DIR/results.json") else # Fallback to grep - TOTAL=$(grep -c '"symbols"' "$DATA_DIR/scan_results.json" || echo 0) - FUZZY_COUNT=$(grep -c '"FUZZY_' "$DATA_DIR/scan_results.json" || echo 0) - BAYES_SPAM_COUNT=$(grep -c '"BAYES_SPAM"' "$DATA_DIR/scan_results.json" || echo 0) - BAYES_HAM_COUNT=$(grep -c '"BAYES_HAM"' "$DATA_DIR/scan_results.json" || echo 0) + TOTAL=$(grep -c '"symbols"' "$DATA_DIR/results.json" || echo 0) + FUZZY_COUNT=$(grep -c '"FUZZY_' "$DATA_DIR/results.json" || echo 0) + BAYES_SPAM_COUNT=$(grep -c '"BAYES_SPAM"' "$DATA_DIR/results.json" || echo 0) + BAYES_HAM_COUNT=$(grep -c '"BAYES_HAM"' "$DATA_DIR/results.json" || echo 0) fi if [ "$TOTAL" -eq 0 ]; then @@ -244,7 +244,7 @@ echo "TEST COMPLETE" echo "============================================================" echo "" echo "Results saved to:" -echo " - $DATA_DIR/scan_results.json" +echo " - $DATA_DIR/results.json" echo " - $DATA_DIR/fuzzy_train.log" echo " - $DATA_DIR/bayes_spam.log" echo " - $DATA_DIR/bayes_ham.log"