The proxy tests take turns over their one film
Browse files at this commit31449fc5643dda4048d41e17e744c79ce6ced181Parent: c319ba2- fix
- the proxy tests take turns over their one film
1 changed file +8 -1
crates/engine/tests/export.rsmodified+8 -1
| @@ -21,9 +21,14 @@ | ||
| 21 | 21 | use std::fs::File; |
| 22 | 22 | use std::io::BufReader; |
| 23 | 23 | use std::path::{Path, PathBuf}; |
| 24 | -use std::sync::Once; | |
| 24 | +use std::sync::{Mutex, Once}; | |
| 25 | 25 | use std::time::{Duration, Instant}; |
| 26 | 26 | |
| 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 | + | |
| 27 | 32 | use engine::export::ExportSettings; |
| 28 | 33 | use engine::hw::HwEncoder; |
| 29 | 34 | use engine::mux::{Mp4Muxer, VideoParams, parameter_sets}; |
| @@ -912,6 +917,7 @@ fn exports_a_gapped_timeline_as_black_and_silence() { | ||
| 912 | 917 | /// hardware one buys is speed, and that is the ignored test below. |
| 913 | 918 | #[test] |
| 914 | 919 | 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()); | |
| 915 | 921 | let _seat = pin_software(); |
| 916 | 922 | let source = asset("test_av.mp4"); |
| 917 | 923 | 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() { | ||
| 1047 | 1053 | /// Software seat, like every default test here ([`pin_software`]). |
| 1048 | 1054 | #[test] |
| 1049 | 1055 | 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()); | |
| 1050 | 1057 | let _seat = pin_software(); |
| 1051 | 1058 | let source = asset("test_av.mp4"); |
| 1052 | 1059 | let out = engine::proxy::path_for(&source).expect("a cache directory"); |