]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Add error logging for scanning phase
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 17 Oct 2025 17:42:39 +0000 (18:42 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 17 Oct 2025 17:42:39 +0000 (18:42 +0100)
Separate stderr to scan_errors.log and display on failure
to debug exit code 123 issue

test/integration/scripts/integration-test.sh

index 941949a9d8d037c1d6278c6169889878ee892957..ac65ca8b99c608217caa523def142f478f025c9b 100755 (executable)
@@ -155,8 +155,20 @@ echo ""
 
 echo "Scanning $TOTAL_EMAILS emails (parallelism: $PARALLEL)..."
 # Scan all files from the corpus using xargs to handle long argument list
+# Log errors separately for debugging
 cat "$DATA_DIR/shuffled_files.txt" | xargs 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/scan_results.json" 2> "$DATA_DIR/scan_errors.log"
+
+SCAN_EXIT=$?
+if [ $SCAN_EXIT -ne 0 ]; then
+    echo "ERROR: Scanning failed with exit code $SCAN_EXIT"
+    echo "First 50 lines of error log:"
+    head -n 50 "$DATA_DIR/scan_errors.log" || true
+    echo ""
+    echo "Last 50 lines of error log:"
+    tail -n 50 "$DATA_DIR/scan_errors.log" || true
+    exit 1
+fi
 
 echo "✓ Scanning complete"
 echo ""