Repository navigation
test: Consolidate Rust integration tests into category binaries; cap test targets (#968) - #978
Conversation
76fce42 to
091f484
Compare
|
Rebased onto master (clean) and grouped obs-gpu-status's 4 newer |
|
Windows Rust Tests failure (job 116974504460) comes from the consolidation itself, not a flake. Two tests fail in the obs-util
The obs-util profiler keeps its roots in process-global state. Before this PR, Fix options:
Option 1 keeps the consolidation, and it is also the regression test for the new layout: a test like this should fail without the lock. |
profiler.rs and profiler_parity.rs both reset the process-global profiler. As separate binaries each ran alone; grouped into one binary libtest runs them on parallel threads, each behind its own mutex, so each saw the other's roots (Windows Rust Tests on #978: 3 roots instead of 2, and an extra empty root in the parity snapshot).
|
Pushed the profiler fix (58b3b50), RED then GREEN:
Locally, |
58b3b50 to
3cfc2dc
Compare
profiler.rs and profiler_parity.rs both reset the process-global profiler. As separate binaries each ran alone; grouped into one binary libtest runs them on parallel threads, each behind its own mutex, so each saw the other's roots (Windows Rust Tests on #978: 3 roots instead of 2, and an extra empty root in the parity snapshot).
|
The merge-queue run failed this PR's own cap check: |
#968) 157 test targets -> 21 (<= 8 per crate). Pure moves via git mv; test count unchanged (1102 passed, 1 ignored). Move-only edits: include_str! paths, mod common -> use super::common, the base_parity self-respawn filter, and the proptest regression files. bmem gets its own binary: it counts allocations process-wide.
profiler.rs and profiler_parity.rs both reset the process-global profiler. As separate binaries each ran alone; grouped into one binary libtest runs them on parallel threads, each behind its own mutex, so each saw the other's roots (Windows Rust Tests on #978: 3 roots instead of 2, and an extra empty root in the parity snapshot).
One PROFILER_LOCK in the category binary's main.rs; profiler.rs and profiler_parity.rs re-export it as TEST_LOCK and PARITY_LOCK, so their tests no longer reset the global profiler under each other.
#814 merged a new crate, obs-preflight, with one integration-test binary. That is a new crate's single binary, not a missed consolidation, so the workspace cap goes from 21 to 22.
|
Rebased onto master again (clean; conflicted after ~4 h idle). |
3cfc2dc to
d0770a6
Compare
#978 moved threading_allocs into the threading binary, where ~40 tests run in parallel and several allocate through bmem, so its absolute deltas of the process-wide bnum_allocs() counter race (macOS master run 38979468586: left 6, right 5). holds_under_concurrent_allocation keeps another thread allocating through bmem while the same measurement runs: it fails every time (5/5 locally, left 7 right 4). Refs #1133
…ust#1209) * test: bnum_allocs checks must hold while other tests allocate (RED) obs-rust#978 moved threading_allocs into the threading binary, where ~40 tests run in parallel and several allocate through bmem, so its absolute deltas of the process-wide bnum_allocs() counter race (macOS master run 38979468586: left 6, right 5). holds_under_concurrent_allocation keeps another thread allocating through bmem while the same measurement runs: it fails every time (5/5 locally, left 7 right 4). Refs obs-rust#1133 * test(obs-util): measure bmem counters in an isolated child process The bnum_allocs checks in threading_allocs and bmem_parity now run alone in a re-exec of the test binary, so the binary's other tests can allocate in parallel without skewing the deltas. Fixes obs-rust#1133
Fixes #968. Refs #700 #897.
RED (f38d92b):
ci/test_binary_cap.py+ci/test_test_binary_cap.py../lintruns them through itsunittest discover -s ci -p test_*.pystep. On master it fails:GREEN (76fce42):
tests/*.rsmoved withgit mvintotests/<category>/<old>.rs, with onemodper file inmain.rs. That takes the workspace from 157 targets to 21: obs-util 8, graphics 3, media-io 2, and 1 for every other crate. The workspace cap is 21.The moves needed a few non-body edits:
include_str!paths gained one../.mod common;becameuse super::common;, andmain.rsnow declares#[path="../common/mod.rs"].base_parityself-respawn now passes the filterbase_parity::default_handler_capture_worker..proptest-regressionsfiles moved next to their tests.memorybinary because it counts allocations process-wide; it failed when it shared a binary.#![cfg]/#![allow]stay as module inner attributes, so they still scope to that one file.Tests: before, 1102 passed and 1 ignored across 156 binaries. After, 1102 passed and 1 ignored across 21 binaries.
Timings (
--no-run, this host):lib.rs: 104.3 s before, 99.1 s after.Docs: the example in testing-policy.md now uses the category layout. No references to
--test <name>or to individual binaries were found inci/,rust/tools,local-gate.tomlor the workflows.