From 7cbe48c80f28190341a70d929d970ecfc6571019 Mon Sep 17 00:00:00 2001 From: Elvis33LE <67311580+Elvis33LE@users.noreply.github.com> Date: Mon, 30 Nov 2026 22:46:01 +0100 Subject: [PATCH] CI: Split the panic hunt and cap Linux Rayon pools (#18439) Run the existing panic hunt as eight ignored Nextest cases in one test binary, preserving every command and input, the harness self-test, and the 180-second deadline per test process. Set RAYON_NUM_THREADS=4 for the Linux gate and no-HEIF job. That limits the default global Rayon pool per process; it does not cap total Nextest concurrency or demonstrate that cluster contention or OOMs are fixed. The eight cases and self-test passed in hosted Ubuntu and Windows on the earlier merge preview and in the scoped current-main Linux validation. The latter used Rayon two. --- .github/workflows/ci.yml | 2 ++ crates/engine/tests/panic_hunt.rs | 33 ++++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47c0dc60c0..922fa9b659 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -206,6 +206,7 @@ jobs: CARGO_PROFILE_TEST_STRIP=symbols PHOTOCRAFT_CI_EXCLUDE=${{ needs.platforms.outputs.linux_skip }} PHOTOCRAFT_CORPUS_TESTS=1 + RAYON_NUM_THREADS=4 timeout-minutes: 100 cache-workspace-crates: true lint-cache: false @@ -347,6 +348,7 @@ jobs: CARGO_NET_RETRY: 10 CARGO_PROFILE_DEV_DEBUG: "0" CARGO_PROFILE_TEST_STRIP: symbols + RAYON_NUM_THREADS: "4" steps: - name: Harden runner uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 diff --git a/crates/engine/tests/panic_hunt.rs b/crates/engine/tests/panic_hunt.rs index 91435bea1a..b0708f25d5 100644 --- a/crates/engine/tests/panic_hunt.rs +++ b/crates/engine/tests/panic_hunt.rs @@ -61,9 +61,10 @@ fn run_guarded(id: &str, p: &Value) -> Result<(), String> { } } -#[test] -#[ignore = "slow full-registry fuzz; run with --ignored"] -fn no_command_panics_or_hangs_on_adversarial_params() { +const SHARDS: usize = 8; + +fn run_panic_hunt_shard(shard: usize) { + assert!(shard < SHARDS); let params: Vec = vec![ json!({}), json!({"x": -9, "y": -9, "radius": 0, "amount": 0, "angle": 0, "opacity": 0, "scale": 0, "levels": 0, "tolerance": 0, "gamma": 0, "layer": 999999, "channel": 999, "index": 999999, "count": 0}), @@ -76,7 +77,10 @@ fn no_command_panics_or_hangs_on_adversarial_params() { json!({"subtractPoints": "none", "order": ["-"], "labMinimum": [0, 0, 0], "labMaximum": [100, 0, 0]}), ]; let mut bad: Vec = Vec::new(); - for spec in command_specs() { + for (idx, spec) in command_specs().iter().enumerate() { + if idx % SHARDS != shard { + continue; + } for p in ¶ms { // Print and Print One Copy reach real printers (lp, or the Windows driver): fuzz them // as dry runs so the hunt never prints a page. @@ -93,9 +97,28 @@ fn no_command_panics_or_hangs_on_adversarial_params() { } } } - assert!(bad.is_empty(), "{} commands panicked:\n{}", bad.len(), bad.join("\n")); + assert!(bad.is_empty(), "shard {shard}: {} commands panicked:\n{}", bad.len(), bad.join("\n")); } +macro_rules! panic_hunt_shard { + ($name:ident, $shard:expr) => { + #[test] + #[ignore = "slow full-registry fuzz; run with --ignored"] + fn $name() { + run_panic_hunt_shard($shard); + } + }; +} + +panic_hunt_shard!(panic_hunt_shard_0, 0); +panic_hunt_shard!(panic_hunt_shard_1, 1); +panic_hunt_shard!(panic_hunt_shard_2, 2); +panic_hunt_shard!(panic_hunt_shard_3, 3); +panic_hunt_shard!(panic_hunt_shard_4, 4); +panic_hunt_shard!(panic_hunt_shard_5, 5); +panic_hunt_shard!(panic_hunt_shard_6, 6); +panic_hunt_shard!(panic_hunt_shard_7, 7); + /// #4982: a panic the code under test contains still fails the run; a graceful `Err` does not. #[test] fn contained_panics_count_and_graceful_errors_do_not() {