← Back to Pull requests

Inject sanitizer runtimes into UI test runners #3149

Closed
unknown closed this pull request without merging on Nov 21, 2026 00:01 UTC
View on GitHub
unknown unknown commented on Nov 20, 2026 22:59 UTC
Author

ios_ui_test with --features=tsan aborts before any test runs:

==52935==ERROR: Interceptors are not working. This may be because ThreadSanitizer is loaded too late (e.g. via dlopen). Please launch the executable with:
DYLD_INSERT_LIBRARIES=.../uitest-Runner.app/PlugIns/uitest.xctest/Frameworks/libclang_rt.tsan_iossim_dynamic.dylib

For UI tests the xctestrun runner moves the test bundle into <name>-Runner.app/PlugIns, but it then looks for libclang_rt.*.dylib (and libMainThreadChecker.dylib) under the bundle's original path $test_tmp_dir/<name>.xctest/Frameworks. Nothing is found there, so DYLD_INSERT_LIBRARIES stays empty and XCTRunner loads the Thread Sanitizer runtime through dlopen with the test bundle.

This looks for them next to test_bundle_binary instead, which already follows the move. Unit tests are unaffected because their bundle stays where it was.

Adds test_ios_ui_test_pass_tsan, the UI test counterpart of test_ios_unit_test_pass_asan. I ran it locally with Xcode 27.2 and the iOS 26.4 simulator runtime: it passes with this change and fails without it, with the error above. test_ios_ui_test_pass still passes. To run it here I had to temporarily change the runners' device_type = "iPhone Xs" to "iPhone 17", because the iPhone Xs can't run iOS 26. I didn't include that change. The Main Thread Checker half of the fix isn't covered by a test.

Found while turning Thread Sanitizer back on for MapLibre Native's iOS UI tests (maplibre/maplibre-native#5075), which applies this as a patch on rules_apple 5.2.0.

🤖 Generated with Claude Code

Diff: 204 lines (+153 / -51) across 2 files Reviewer: keith Review duration: 62m
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 204 lines diff across 2 files
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.318
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3149"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.3% (MEDIUM) · Higher = larger blast radius
36.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.3% · Safe to merge
14.3%