mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
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.
This commit is contained in:
1 parent
1553cd3c9e
commit
7cbe48c80f
2 files changed
+30
-5
No files matched your search
@@ -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
|
||||
|
||||
@@ -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<Value> = 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<String> = 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() {
|
||||
|
||||
Reference in new issue
Block a user