Skip to content

test(obs-util): isolate bmem counter checks in a child process - #1209

Merged
zackees merged 2 commits into
masterfrom
fix/1133-isolate-alloc-counter-tests
Oct 17, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/1133-isolate-alloc-counter-tests

Conversation

@zackees

@zackees zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Fixes #1133.

bnum_allocs is process-global, so the absolute-delta checks in threading_allocs and bmem_parity::matches_c_oracle raced with the other tests of their binaries.

  • RED (dfe4e81): threading_allocs::holds_under_concurrent_allocation keeps a thread allocating while the measurement runs; it failed 5/5 (left: 7, right: 4).
  • GREEN (bc78d71): new tests/common::isolated(name) re-execs the test binary for exactly that test (--exact --test-threads=1, marker env var). The parent asserts the child passed and ran one test. Both counter checks now measure only in the child, so the new test passes with its allocating thread still running.

No new test binaries (obs-util stays at the 8-binary cap). Local: ./lint ok; soldr cargo test -p obs-util --test memory --test threading 10 + 41 passed.

@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

Tier 2 failure here is master's (derived only 0 ported objects, from #1208), not this change; fix in #1213. Will rerun after it merges.

#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
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 #1133
@zackees
zackees force-pushed the fix/1133-isolate-alloc-counter-tests branch from bc78d71 to 622236d Compare October 17, 2026 09:45
@zackees
zackees added this pull request to the merge queue Oct 17, 2026
Merged via the queue into master with commit 705abf7 Oct 17, 2026
29 checks passed
@zackees
zackees deleted the fix/1133-isolate-alloc-counter-tests branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Flaky: tests that need process-wide isolation race since #978 merged them into shared binaries

1 participant