Skip to content

ci(sanitizers): the ASan unit tests run one at a time and take 20 of the job's 26 minutes #3238

Closed
13 of 14 issues completed

Description

@vpacher

What

Since #3129 the PR asan job restores its compiler cache, and the build is no longer the slow part. A warm run (job 124607914449, 2026-10-31):

Phase Minutes
Install dependencies 0.7
Configure + build (HYBRID libobs) 4.1
Unit tests 19.8
App launch (45 s window) 0.9
Clang conversion replay 0.3

All finished PR asan jobs with a cache hit on 2026-10-31 took 26–29 minutes; cold ones took 46–56.

run_unit_tests() in rust/tools/sanitize/sanitize.py runs the 633 registered tests one after another (for test in tests: run_one_test(...), each a subprocess.run with a 600 s timeout) on a 4-core ubuntu-26.04 runner. It prints the test names only after the last test, without times, so the log cannot show which tests are slow.

Proposed

  1. Run the tests in a pool of workers (the runner's CPU count). Keep the tests that must not share the machine alone: ctest --show-only=json-v1, which sanitize.py already reads, gives each test's properties. Tests with RUN_SERIAL (today test_deinterlace_2x_field_order_* and the four test_xshm_* tests) run after the pool, one at a time, as ctest does. Each test keeps its own log file and sanitizer options, as now.
  2. Record each test's seconds in summary.txt and print the slowest ones, so a slow test shows in the log.

Estimate, not measured: with 4 workers the unit-test phase could drop from about 20 to about 6–8 minutes, depending on how much time the serial tests take and on the memory headroom. ASan roughly doubles memory use; the runner has 16 GB.

Acceptance:

  • Before and after times of the asan job and of the unit-test phase on the same commit, in the PR.
  • The same tests run, with the same exit codes and the same sanitizer reports as a serial run of that commit.
  • No new flaky test over a few reruns; a test that turns out to need the machine alone gets RUN_SERIAL in its tests.d file rather than a special case in sanitize.py.

Notes

  • valgrind and tsan use the same function; this issue is about asan, the one that runs on PRs. The same pool could serve the other tools later.
  • Not part of this issue: 21 tests exit non-zero in the asan run and the job still passes (PipeWire, Pulse and v4l2 device tests, test_dock_proportions, test_transition_render_steps, test_ws_cpu_usage). Whether each is an expected skip or a hidden failure is worth its own look.

Sub-issues

Sub-issues

13 of 14 Issues completed
Loading 14 sub-issues

Activity

  1. added
    infra
    P2
    size:M
    on Oct 31, 2026
  2. zackees commented on Oct 31, 2026

    @zackees
    Member

    /ready

  3. added
    ready
    on Oct 31, 2026
  4. vpacher commented on Oct 31, 2026

    @vpacher
    MemberAuthor

    Claiming: #3238

    Plan (one PR):

    1. RED: tests for sanitize.py (offline, fake tests): the runner reads each test's RUN_SERIAL from ctest --show-only=json-v1, runs the others in a pool of the runner's CPU count, runs the serial ones alone after the pool, keeps one log file and the sanitizer options per test, keeps the summary in ctest order with the exit codes, and records the seconds per test.
    2. GREEN: the pool in run_unit_tests(), plus the slowest tests printed after the summary.
    3. Before/after: the asan job and its unit-test phase on the same commit, in the PR (a dispatch of sanitizers.yaml on the branch), with the summary compared to a serial run.

    First PR within a day.

  5. 58 remaining items

  6. vpacher commented on Nov 1, 2026

    @vpacher
    MemberAuthor

    Fixed by #3290 (93070d8), with #3403 and #3404 first.

    • The sanitizer passes run their unit tests side by side: asan and tsan on every core, valgrind two at a time, each test on its own X server; timing-sensitive tests run alone after the pool. Jobs: asan 20.7 min (was 40.6), tsan 28.5 min (was 41), valgrind 66.5 min (was 95, now with the 101 tests that died at start).
    • The asan job fails on findings. Tests that fail on master today are in the known list (rust/tools/sanitize/triage.py), each with its issue.

    What is left, all sub-issues of this issue:

  7. moved this from In progress to Done in obs-rust Multiviewon Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2infrareadysize:M

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions