Przeglądaj źródła

Merge pull request #433 from r4tedx/tests/serialise-valu-gpu-tests

Shader tests: run the VALU GPU tests one at a time (cargo test hangs now and then)
Marvis 2 dni temu
rodzic
commit
0ddbce888e
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      crates/victory-shader/src/emit/valu_tests.rs

+ 5 - 0
crates/victory-shader/src/emit/valu_tests.rs

@@ -166,6 +166,11 @@ fn run_cases(
     cases: &[[u32; 4]],
     cases: &[[u32; 4]],
     mut check: impl FnMut(&str, usize, [u32; 4], u32),
     mut check: impl FnMut(&str, usize, [u32; 4], u32),
 ) {
 ) {
+    // One test at a time: with these tests on the hardware adapter and WARP
+    // from several test threads at once, now and then none of their
+    // dispatches ever completes and the test binary hangs.
+    static ONE_AT_A_TIME: std::sync::Mutex<()> = std::sync::Mutex::new(());
+    let _one = ONE_AT_A_TIME.lock().unwrap_or_else(|e| e.into_inner());
     let mut ran = 0;
     let mut ran = 0;
     for (label, warp) in [("hardware", false), ("warp", true)] {
     for (label, warp) in [("hardware", false), ("warp", true)] {
         let Ok(host) = Host::new(warp) else {
         let Ok(host) = Host::new(warp) else {