Skip to content

Fix the data race the thread sanitizer found in RegistryNetworkTests - #301

Merged
jiunbae merged 1 commit into
mainfrom
fix/registry-test-race
Nov 16, 2026
Merged

jiunbae merged 1 commit into
mainfrom
fix/registry-test-race

Conversation

@jiunbae

@jiunbae jiunbae commented Nov 16, 2026

Copy link
Copy Markdown
Member

The scheduled Thread Sanitizer run on main failed (run 43856065244). The race is in test code: RegistryNetworkProtocol.stopped is read by CFNetwork's thread in stopLoading() while RegistryNetworkTests.tearDown() clears it. It is intermittent — a rerun on CI passed; a local loop reproduced it on the first pass.

The stub's four statics now sit behind one lock. No product code changes.

Checked with swift test --sanitize=thread --filter MenubucketCoreTests and halt_on_error=1: reproduced before the change; 9 consecutive runs with 0 reports after (941 tests each).

🤖 Generated with Claude Code

…lock

The URL loading system calls the protocol on its own threads while the test
sets its statics up and tears them down. A late stopLoading raced tearDown
clearing the expectation; the weekly thread sanitizer run caught it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@jiunbae
jiunbae enabled auto-merge November 16, 2026 11:51
@jiunbae
jiunbae added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit a868e77 Nov 16, 2026
6 checks passed
@jiunbae
jiunbae deleted the fix/registry-test-race branch November 16, 2026 12: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