From 31449fc5643dda4048d41e17e744c79ce6ced181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Wed, 19 Aug 2026 19:05:46 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(engine):=20the=20proxy=20tes?= =?UTF-8?q?ts=20take=20turns=20over=20their=20one=20film?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both proxy tests proxy test_av.mp4, and a proxy job is one per film: run in the same binary, whichever asked second was refused ("a stand-in for this film is already being made") and a cancel in one deleted the file the other was asserting about -- the rotating failure this binary has shown all sweep, misread as starvation until the panic named it. A shared mutex serializes the pair; everything else still runs wide. --- crates/engine/tests/export.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/engine/tests/export.rs b/crates/engine/tests/export.rs index 7cd0eba..20cf1fb 100644 --- a/crates/engine/tests/export.rs +++ b/crates/engine/tests/export.rs @@ -21,9 +21,14 @@ use std::fs::File; use std::io::BufReader; use std::path::{Path, PathBuf}; -use std::sync::Once; +use std::sync::{Mutex, Once}; use std::time::{Duration, Instant}; +/// The two proxy tests below share one film, and a proxy job is one per film: +/// run together, whichever asks second is refused ("already being made"), and +/// a cancel in one deletes what the other is asserting about. One at a time. +static PROXY_FILM: Mutex<()> = Mutex::new(()); + use engine::export::ExportSettings; use engine::hw::HwEncoder; use engine::mux::{Mp4Muxer, VideoParams, parameter_sets}; @@ -912,6 +917,7 @@ fn exports_a_gapped_timeline_as_black_and_silence() { /// hardware one buys is speed, and that is the ignored test below. #[test] fn a_proxy_is_picture_only_every_frame_a_starting_point_and_cached() { + let _film = PROXY_FILM.lock().unwrap_or_else(|e| e.into_inner()); let _seat = pin_software(); let source = asset("test_av.mp4"); let out = engine::proxy::path_for(&source).expect("a cache directory"); @@ -1047,6 +1053,7 @@ fn a_proxy_is_picture_only_every_frame_a_starting_point_and_cached() { /// Software seat, like every default test here ([`pin_software`]). #[test] fn a_stopped_proxy_leaves_neither_a_stand_in_nor_half_of_one() { + let _film = PROXY_FILM.lock().unwrap_or_else(|e| e.into_inner()); let _seat = pin_software(); let source = asset("test_av.mp4"); let out = engine::proxy::path_for(&source).expect("a cache directory");