Skip to content

Add async local override for build server detector#678

Merged
SimonCropp merged 2 commits intomainfrom
Add-async-local-override-for-BuildServerDetector
Feb 4, 2026
Merged

Add async local override for build server detector#678
SimonCropp merged 2 commits intomainfrom
Add-async-local-override-for-BuildServerDetector

Conversation

@SimonCropp
Copy link
Member

No description provided.

Introduce an AsyncLocal-backed override for BuildServerDetector.Detected so tests (and other async-scoped code) can set the detected value without leaking to other threads. The static initialization now stores the computed detection in a private 'detected' field, and the Detected property reads from overrideDetected.Value ?? detected and sets overrideDetected.Value. Added unit tests to verify the override persists in the async context and doesn't leak, and updated readme/source docs with a snippet explaining how to override Detected in tests.
@SimonCropp SimonCropp added this to the 18.4.0 milestone Feb 4, 2026
@SimonCropp SimonCropp merged commit 8c154ec into main Feb 4, 2026
7 checks passed
@SimonCropp SimonCropp deleted the Add-async-local-override-for-BuildServerDetector branch February 4, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant