-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: Port rpc changes from corefx #209
Conversation
Hi @Wraith2 Please check and confirm code coverage (as close to 100% as possible) on changes made here. If RPC tests don't exist, please add them to the suite so they cover maximum line changes here. |
How do I check coverage? Given that this effects how you do queries it'd be quite surprising if it wasn't covered. |
I'm definitely going to need help getting coverage. I've tried getting the manual tests running in visual studio and i'm unable to apply the required environment variables (launchsettings.json doesn't work for some reason) and the tests themselves won't execute because of an nuint serialization exception. So either I need some guidance on how you get it working in visual studio or how to get coverage numbers from msbuild and use them sensibly. |
Sure, I'd expect it to be covered too, we just want to verify if we have everything covered here. So maybe try running tests in Visual Studio with coverage plugins? Also extracted this coverage report for this PR, hope it serves well as a starting point. |
FYI, you can also run |
Should tests run from within visual studio? When I try I get this error which stops the entire run:
I can't use the coverage file you provided because I'm only on visual studio pro. Code coverage is an enterprise or ultimate feature and since I buy my own visual studio license rather than getting it through an employer or volume license both editions are way out of my reach. If I could get the test running resharper should provide coverage, but that hits the error above. |
Hi @Wraith2 |
None of the release mode configurations work for me either. I get an exception from inside xunit extensions. The coverage cli commands suggested aren't recognised at the commandline when appended to the test commands and the dotnet cli docs don't list them even though I can find the feature request for them being added, perhaps post 2.1 dotnet only. using /p:CollectCoverage=true doesn't seem to do anything either. I've opened a couple of tracking issues for test and coverage. At the moment I can't provide any coverage data. |
Now that 1.1.0 is out can this be reviewed please? It's been rebased and is only failing on that AE tests that fail in master as well. This work is needed for the batch implementation. |
Hi @Wraith2 Yes, please update your branch with changes from master to trigger a fresh CI build. |
Updated. |
Thanks @Wraith2 It looks like the Enclave Provider tests are failing for .NET Core, please check logs in the checks (they're public now) and review implementation to find related code changes. It's tricky to get the setup for Enclave Provider for debugging, so I'd recommend going down your changes and understanding failing tests to fix what went wrong. You'd be the best person to review first and fix the issues being creator of the PR, we'll start reviewing once we have all tests passing and changes are ready to check-in. If you need any help let us know. From the logs:
|
So does SQL17W-E mean with enclave? I can guess from stack traces but realistically if I'm (any anyone else) going to need to ensure enclaves work we'll need instructions on how to set up and run those tests correctly, can you provide something? |
Sure, you can begin from here: https://docs.microsoft.com/en-us/sql/relational-databases/security/tutorial-getting-started-with-always-encrypted-enclaves for setup, and use following tutorials to setup .NET Applications, same instructions apply for Microsoft.Data.SqlClient, except that Enclave provider is internally available and does not need additional package reference. We are also just-in-process of putting specific documentation for Microsoft.Data.SqlClient, since now Enclave provider is available in GA 1.1 |
The changes are done and pass locally on the same tests as master. The SQL12E-E leg is failing with timeouts and flaky tests from what I can see, can you retry that leg? |
Hi @Wraith2 Please trigger a new build by pushing a commit. DevOps recently has some issues with Rebuild. |
New build triggered and looks like it's been stuck overnight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the few small nits, looks good to me. Thanks!
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlCommand.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve conflicts and comments, and then we're good!
This is a port of dotnet/corefx#34049 which changes how rpc object are constructed and re-used so avoid repeated creation of new SqlParameter instances where they aren't needed.
This change was not brought across from corefx initially because the introduction of AlwaysEncrypted required additionally changes. Those changes are part of this new PR. manual tests pass in debug mode (with all asserts) so it looks like the AE changes are ok but I'd like some oversight to make sure I've understood what it's doing correctly.
I think I've found a weakness in the batch rpc mode with AE. It assumes that the command will be in sysemParams[0] but this is only true if the batch rpc was constructed as an sql command and not as a stored procedure. This isn't currently causing a problem but might need tightening up.