fix(tests): make the platform-specific suites portable and deterministic
Four independent CI failures the first real cross-platform run surfaced: - macOS SIGSEGV: the real-GL unit tests in gl_bridge ran wherever CGL is available, including the headless CI runner. Gate them with the same OAK_GPU_TESTS switch the integration GL tests already use (skip on CI, opt in on a real Mac). - Windows build: examples compile under `cargo test`, and bench_playback used libc::getrusage unconditionally. Keep the Unix CPU accounting behind #[cfg(unix)] and report zero CPU seconds elsewhere. - openKylin arm64: engine_without_a_project_hits_the_guard_paths assumed the library backend was unconfigured while a parallel config test transiently set Storage/Backend=sqlite. Take the shared config lock and pin the key off for the test's duration. - openKylin x64: the prefetch smoke test asserted an exact decode count, but the hand-off LRU holds only DECODE_LRU_CAP (2) frames, so a request can miss the prefetched copy under scheduling pressure and re-run the producer (the eval cache still serves the pixels). Bound the count instead of pinning it; the deterministic sibling test pins read-ahead usage.
This commit is contained in:
@@ -913,10 +913,25 @@ fn pipeline_playback_prefetches_ahead_of_the_render() {
|
||||
times.len() as u64,
|
||||
"every playback post queued its footage prefetch"
|
||||
);
|
||||
assert_eq!(
|
||||
// Each distinct frame is produced at least once. The hand-off LRU holds
|
||||
// only `DECODE_LRU_CAP` (2) frames, so under scheduling pressure a
|
||||
// request can miss the prefetched copy and re-run the producer; the
|
||||
// eval-side cache still serves the pixels without touching the media,
|
||||
// but the counter moves. Bound this to one production per command
|
||||
// (prefetch + request) instead of asserting an exact count; the
|
||||
// deterministic `pipeline_prefetch_is_the_frame_the_render_request_uses`
|
||||
// pins that the read-ahead is actually used.
|
||||
assert!(
|
||||
stats.decodes >= times.len() as u64,
|
||||
"each distinct frame is produced at least once ({} < {})",
|
||||
stats.decodes,
|
||||
times.len() as u64,
|
||||
"each distinct frame decodes exactly once (prefetch or rendezvous)"
|
||||
times.len()
|
||||
);
|
||||
assert!(
|
||||
stats.decodes <= 2 * times.len() as u64,
|
||||
"at most one production per prefetch and per request ({} > {})",
|
||||
stats.decodes,
|
||||
2 * times.len()
|
||||
);
|
||||
// Note: `procpool::main_heap_frame_copies` only counts the shm path,
|
||||
// which the thread pipeline never touches, so asserting it here would
|
||||
|
||||
Reference in New Issue
Block a user