Skip to content

test: isolate tracing capture from parallel callsite registration - #83

Merged
fannnzhang merged 1 commit into
mainfrom
bugfix/tracing-test-isolation
Nov 13, 2026
Merged

fannnzhang merged 1 commit into
mainfrom
bugfix/tracing-test-isolation

Conversation

@fannnzhang

Copy link
Copy Markdown
Contributor

Parallel integration tests could lose tracing spans/events because scoped subscribers share a process-wide callsite interest cache with unrelated HTTP tests. This was reproduced on unmodified main (spans = []) and also caused PR #82's macOS body-failure trace assertion to fail. The old capture-only mutex did not exclude ordinary tests registering those callsites.

Move the three existing capture scenarios to tests/tracing.rs and execute each in a fresh copy of that test binary using --exact. Parent tests remain parallel; child PID and completion-marker checks prevent inline execution or a zero-test filter from silently passing. Child failures retain stdout/stderr. All original scenario actions and assertions are preserved, and the ineffective capture lock is removed.

Add three regressions for parent callsite-state isolation, child-panic diagnostics and empty-filter rejection. Production code, public APIs, dependencies and CI parallelism are unchanged. This PR is based directly on main and is independent of the Age repair in #82. Root cause and verification.

Validation on macOS arm64, Rust 1.99.1, with normal parallel test execution:

  • cargo test --workspace --all-targets: 567 passed, 16 ignored.
  • cargo test --workspace --all-targets --all-features: 608 passed, 16 ignored.
  • cargo test --workspace --all-features --doc: 2 passed.
  • The events, timeout/cancellation and tracing binaries: 34 passed with 8 test threads, followed by 10 successful additional rounds (340 cases).
  • cargo clippy --workspace --all-targets -- -D warnings and cargo fmt --all --check: passed.

No RUST_TEST_THREADS=1 workaround is required. Isolation is established by process/PID and cold-callsite regressions; stress repetitions are supplementary evidence.

@fannnzhang
fannnzhang merged commit edb53ed into main Nov 13, 2026
10 checks passed
@fannnzhang
fannnzhang deleted the bugfix/tracing-test-isolation branch November 13, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant