Repository navigation
Update Clone isolation test for Abstractions 12.6.1 - #4021
Merged
Bogdan Gavril (bgavrilMS) merged 1 commit intoSep 1, 2026
Conversation
Microsoft.Identity.Abstractions 12.6.1 changes Clone()/copy constructors to allocate independent containers for the mutable collections (ExtraParameters, ExtraQueryParameters, ExtraHeadersParameters). SidecarOptionsIsolationTests .Clone_IsShallow_OnSharedMutableCollections asserted the previous shared- reference behavior and now fails. Rename it to Clone_IsolatesSharedMutableCollections and assert the collections are independent after Clone() (NotSame, and a write to the clone does not appear on the original). The sibling CloneForRequest test is unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5d7561d5-2377-4311-b964-18a751a83302
Bogdan Gavril (bgavrilMS)
approved these changes
Sep 1, 2026
Bogdan Gavril (bgavrilMS)
merged commit Sep 1, 2026
3fb0425
into
gladjohn-MicrosoftIdentityAbstractionsVersion
2 checks passed
Bogdan Gavril (bgavrilMS)
deleted the
iarekk/fix-clone-isolation-test
branch
September 1, 2026 10:35
Bogdan Gavril (bgavrilMS)
pushed a commit
that referenced
this pull request
Sep 1, 2026
Microsoft.Identity.Abstractions 12.6.1 changes Clone()/copy constructors to allocate independent containers for the mutable collections (ExtraParameters, ExtraQueryParameters, ExtraHeadersParameters). SidecarOptionsIsolationTests .Clone_IsShallow_OnSharedMutableCollections asserted the previous shared- reference behavior and now fails. Rename it to Clone_IsolatesSharedMutableCollections and assert the collections are independent after Clone() (NotSame, and a write to the clone does not appear on the original). The sibling CloneForRequest test is unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5d7561d5-2377-4311-b964-18a751a83302
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Targets #4020. That PR bumps
MicrosoftIdentityAbstractionsVersionto 12.6.1,which changes
Clone()/ the copy constructors onAcquireTokenOptionsandDownstreamApiOptionsto allocate independent containers for their mutablecollections (
ExtraParameters,ExtraQueryParameters,ExtraHeadersParameters)instead of copying the references
(AzureAD/microsoft-identity-abstractions-for-dotnet#269).
SidecarOptionsIsolationTests.Clone_IsShallow_OnSharedMutableCollectionswaswritten to document the previous shared-reference behavior (it asserts
Assert.Sameon the collections and that a write to the clone appears on theoriginal). Under 12.6.1 those assertions invert, so the test fails the
Build & Unit Tests run on #4020.
Change
Rename the test to
Clone_IsolatesSharedMutableCollectionsand assert the newbehavior: after
Clone(), the mutable collections areNotSameand a write tothe clone does not appear on the original. The sibling
CloneForRequest_ReallocatesSharedMutableCollectionstest is unaffected (itstill re-allocates and still passes).
Notes
DownstreamApiOptionsMerger.CloneForRequestis now effectively belt-and-suspenders (the underlying
Clone()already isolates), but it remains correctand is left as-is; simplifying it can be a separate follow-up.
Testing
SidecarOptionsIsolationTestspasses against 12.6.1 (net10.0). CoreMicrosoft.Identity.Web.Testunit tests pass against 12.6.1 as well.