Repository navigation
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
unsafePtr
marked this pull request as ready for review
November 13, 2026 15:14
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
Compare dictionary entries by key and value without depending on iteration order. Preserve initial equality checks and cover boxed values, missing keys, and mismatched counts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
@unsafePtr - Thanks for noticing this TODO and addressing it. I noticed some additional weaknesses in the data comparison loop and have added another commit. |
Contributor
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
paulmedynski
approved these changes
Nov 13, 2026
paulmedynski
enabled auto-merge (squash)
November 13, 2026 15:53
This branch has not been deployed
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.
Description
Correct the exception-clone assertion so it compares the dictionaries from both exceptions rather than comparing a value with itself. Match entries by key and compare values with null-safe value equality, without assuming matching dictionary enumeration order. Preserve the initial metadata and count checks instead of overwriting failed checks in the error-comparison loop.
This changes test validation only; there are no driver API or runtime behavior changes. The existing SQL-backed ExceptionTests test invokes this helper after repeated pooled connection failures.
Issues
Follow-up discussion: #5064
Testing
The five original database-free cases cover matching non-null and null values, different values, and both null/non-null mismatch directions. Seven additional cases cover separately boxed equal values, reordered entries with equal but distinct keys, count mismatches in both directions, and missing keys with null values.
Before the loop fix, the focused run passed eight cases and failed four; after the fix, all 12 passed with no skips.
dotnet test src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj --framework net10.0 --list-tests --filter 'FullyQualifiedName~CheckThatExceptionsAreDistinctButHaveSameData' --verbosity quiet- passed; discovered all 12 cases.dotnet test src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj --framework net10.0 --no-restore --filter 'FullyQualifiedName~CheckThatExceptionsAreDistinctButHaveSameData' --verbosity quiet- passed; 12 passed, zero failed, zero skipped.dotnet build src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj --framework net462 --no-restore --verbosity quiet- passed; zero warnings and zero errors.git diff --check- passed.SQL-backed tests were not rerun for this follow-up. The original PR reported that a broader .NET 10 ExceptionTest run passed six cases, skipped two, and failed four database-dependent cases because the configured SQL Server was unavailable. .NET Framework execution was not performed on Linux.
Guidelines
Please review the contribution guidelines before submitting a pull request: