[6.1] Test | Fix Diagnostic Tests and remove Remote Executor (#4078)#4268
Closed
cheenamalhotra wants to merge 1 commit into
Closed
[6.1] Test | Fix Diagnostic Tests and remove Remote Executor (#4078)#4268cheenamalhotra wants to merge 1 commit into
cheenamalhotra wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Ports PR #4078 onto the release/6.1 branch to get Diagnostics manual tests running reliably without Microsoft.DotNet.RemoteExecutor, and adjusts SqlConnection.OpenAsync diagnostic continuation behavior in the netcore implementation.
Changes:
- Refactors
DiagnosticTestto run in-process (no remote executor), serialize execution via an xUnit collection, and validate expected diagnostic events. - Removes
Microsoft.DotNet.RemoteExecutorfrom manual test project/package dependency lists. - Updates
SqlConnection.InternalOpenAsyncto attach the diagnostic completion continuation with explicit continuation options.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/tests/ManualTests/TracingTests/DiagnosticTest.cs | Reworks diagnostic manual tests to avoid remote execution and to assert presence of expected diagnostic events. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj | Drops the RemoteExecutor package reference for manual tests. |
| src/Microsoft.Data.SqlClient/tests/Directory.Packages.props | Removes centralized package version entry for RemoteExecutor. |
| src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlConnection.cs | Adjusts the OpenAsync continuation wiring for diagnostic completion handling. |
| using SqlCommand cmd = new("SELECT *, baddata = 1 / 0 FROM sys.objects FOR xml auto, xmldata;", conn); | ||
| #endif | ||
| conn.Open(); | ||
| Assert.Throws<SqlException>(() => cmd.ExecuteXmlReader()); |
Comment on lines
+377
to
380
| foreach (string expected in expectedDiagnostics) | ||
| { | ||
| Assert.True(observer.HasReceivedDiagnostic(expected), $"Missing diagnostic '{expected}'"); | ||
| } |
Comment on lines
+412
to
415
| foreach (string expected in expectedDiagnostics) | ||
| { | ||
| Assert.NotNull(kvp.Value); | ||
|
|
||
| SqlConnection sqlConnection = GetPropertyValueFromType<SqlConnection>(kvp.Value, "Connection"); | ||
| Assert.NotNull(sqlConnection); | ||
|
|
||
| string operation = GetPropertyValueFromType<string>(kvp.Value, "Operation"); | ||
| Assert.False(string.IsNullOrWhiteSpace(operation)); | ||
|
|
||
| statistics = GetPropertyValueFromType<IDictionary>(kvp.Value, "Statistics"); | ||
|
|
||
| Guid connectionId = GetPropertyValueFromType<Guid>(kvp.Value, "ConnectionId"); | ||
| Assert.NotEqual(connectionId, Guid.Empty); | ||
|
|
||
| statsLogged = true; | ||
| Assert.True(observer.HasReceivedDiagnostic(expected), $"Missing diagnostic '{expected}'"); | ||
| } |
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| using System; | ||
| using System.Collections; |
| using System.Reflection; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Threading.Tasks; | ||
| using System.Xml; |
Member
Author
|
Discarded since #3658 isn't part of 6.1. |
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.
Ports #4078 to release/6.1 branch to enable Diagnostics Testing and remove remote executor.