[7.0.3 Cherry-pick] AE tests: create ConversionTests keys once per class to slow error 3807 identifier exhaustion - #4485
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
…07 identifier exhaustion (#4478)
14dd39e to
f255ee5
Compare
There was a problem hiding this comment.
Pull request overview
Backport of the upstream fix to reduce SQL Server error 3807 (“identifier exhaustion”) in Always Encrypted manual tests by creating the CMK/CEK once per ConversionTests class instead of once per test case.
Changes:
- Added
ConversionTestFixture(IClassFixture) that creates a shared CMK+CEK once per test class and drops them on fixture disposal. - Refactored
ConversionTeststo consume the shared CEK from the fixture and to only drop per-test tables inDispose().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/ConversionTestFixture.cs | New class fixture that creates/drops shared CMK/CEK for ConversionTests. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ConversionTests.cs | Switches from per-test constructor key creation to using the shared fixture CEK; keeps per-test table lifecycle. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## release/7.0 #4485 +/- ##
===============================================
- Coverage 74.68% 65.72% -8.96%
===============================================
Files 280 275 -5
Lines 43923 65953 +22030
===============================================
+ Hits 32802 43349 +10547
- Misses 11121 22604 +11483
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Backports #4478 to
release/7.0for the 7.0.3 servicing release. The cherry-pick conflicts have been resolved manually.This fixes recurring SQL Server error 3807 (
Create failed because all available identifiers have been exhausted.) in the Always Encrypted manual tests.ConversionTestspreviously created a Column Master Key and Column Encryption Key for every test case, advancing SQL Server's monotonic per-database identifier counter even after the keys were dropped.The change adds an
IClassFixturethat creates the keys once per test class and drops them when the fixture is disposed. Per-test tables continue to be created and dropped for each case. This substantially reduces key identifier consumption without changing the public API.Issues
Backport of #4478.
Testing
sqlclient-ci-kerberosrun 20260727.4.release/7.0; resulting branch contains the expected two-file change.