]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Test] Use rspamc -n instead of xargs for parallel scanning
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 17 Oct 2025 15:13:22 +0000 (16:13 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 17 Oct 2025 15:13:22 +0000 (16:13 +0100)
rspamc already supports parallelism via -n flag

test/integration/scripts/integration-test.sh

index 6da4fa1421a3162d8d67b16719ad938ae708ef69..287a351cb2a8392e9ca7de8c1d5a206a4da8897e 100755 (executable)
@@ -154,10 +154,9 @@ echo "============================================================"
 echo ""
 
 echo "Scanning $TOTAL_EMAILS emails (parallelism: $PARALLEL)..."
-# Scan all files from the shuffled list
-cat "$DATA_DIR/shuffled_files.txt" | xargs -n 1 -P "$PARALLEL" \
-    rspamc -h "$RSPAMD_HOST:$CONTROLLER_PORT" -P "$PASSWORD" -j \
-    > "$DATA_DIR/scan_results.json" 2>&1
+# Scan all files from the corpus
+rspamc -h "$RSPAMD_HOST:$CONTROLLER_PORT" -P "$PASSWORD" -n "$PARALLEL" -j \
+    $(cat "$DATA_DIR/shuffled_files.txt") > "$DATA_DIR/scan_results.json" 2>&1
 
 echo "✓ Scanning complete"
 echo ""
@@ -232,9 +231,8 @@ if [ "$TEST_PROXY" = "true" ]; then
 
     echo "Testing via proxy worker ($PROXY_PORT)..."
     # Use a sample of files for proxy test
-    head -n 100 "$DATA_DIR/shuffled_files.txt" | xargs -n 1 -P "$PARALLEL" \
-        rspamc -h "$RSPAMD_HOST:$PROXY_PORT" -j \
-        > "$DATA_DIR/proxy_results.json" 2>&1
+    rspamc -h "$RSPAMD_HOST:$PROXY_PORT" -n "$PARALLEL" -j \
+        $(head -n 100 "$DATA_DIR/shuffled_files.txt") > "$DATA_DIR/proxy_results.json" 2>&1
     echo "✓ Proxy test complete"
     echo "Results saved to $DATA_DIR/proxy_results.json"
 fi