forge
Explore
Log in

Don't you dare go Hollow

The proxy tests take turns over their one film

Browse files at this commit

31449fc5643dda4048d41e17e744c79ce6ced181Ahmet Kaan GümüşParent: c319ba2
  • fix
    • the proxy tests take turns over their one film
Show full message
🐛 fix(engine): the proxy tests take turns over their one film

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.rsmodified+8 -1
@@ -21,9 +21,14 @@
2121 use std::fs::File;
2222 use std::io::BufReader;
2323 use std::path::{Path, PathBuf};
24-use std::sync::Once;
24+use std::sync::{Mutex, Once};
2525 use std::time::{Duration, Instant};
2626
27+/// The two proxy tests below share one film, and a proxy job is one per film:
28+/// run together, whichever asks second is refused ("already being made"), and
29+/// a cancel in one deletes what the other is asserting about. One at a time.
30+static PROXY_FILM: Mutex<()> = Mutex::new(());
31+
2732 use engine::export::ExportSettings;
2833 use engine::hw::HwEncoder;
2934 use engine::mux::{Mp4Muxer, VideoParams, parameter_sets};
@@ -912,6 +917,7 @@ fn exports_a_gapped_timeline_as_black_and_silence() {
912917 /// hardware one buys is speed, and that is the ignored test below.
913918 #[test]
914919 fn a_proxy_is_picture_only_every_frame_a_starting_point_and_cached() {
920+ let _film = PROXY_FILM.lock().unwrap_or_else(|e| e.into_inner());
915921 let _seat = pin_software();
916922 let source = asset("test_av.mp4");
917923 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() {
10471053 /// Software seat, like every default test here ([`pin_software`]).
10481054 #[test]
10491055 fn a_stopped_proxy_leaves_neither_a_stand_in_nor_half_of_one() {
1056+ let _film = PROXY_FILM.lock().unwrap_or_else(|e| e.into_inner());
10501057 let _seat = pin_software();
10511058 let source = asset("test_av.mp4");
10521059 let out = engine::proxy::path_for(&source).expect("a cache directory");