Skip to content

[7.0.3 Cherry-pick] AE tests: create ConversionTests keys once per class to slow error 3807 identifier exhaustion - #4485

Merged
paulmedynski merged 2 commits into
release/7.0from
dev/automation/pr-4478-to-7.0.3
Jul 30, 2026
Merged

[7.0.3 Cherry-pick] AE tests: create ConversionTests keys once per class to slow error 3807 identifier exhaustion#4485
paulmedynski merged 2 commits into
release/7.0from
dev/automation/pr-4478-to-7.0.3

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Description

Backports #4478 to release/7.0 for 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. ConversionTests previously 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 IClassFixture that 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

  • Source change validated by sqlclient-ci-kerberos run 20260727.4.
  • Cherry-pick conflicts resolved against release/7.0; resulting branch contains the expected two-file change.

@github-actions github-actions Bot added this to the 7.0.3 milestone Jul 29, 2026
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Jul 29, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@paulmedynski
paulmedynski force-pushed the dev/automation/pr-4478-to-7.0.3 branch from 14dd39e to f255ee5 Compare July 29, 2026 16:39
@paulmedynski paulmedynski changed the title [7.0.3 Cherry-pick - CONFLICTS] AE tests: create ConversionTests keys once per class to slow error 3807 identifier exhaustion [7.0.3 Cherry-pick] AE tests: create ConversionTests keys once per class to slow error 3807 identifier exhaustion Jul 29, 2026
paulmedynski
paulmedynski previously approved these changes Jul 29, 2026
@paulmedynski
paulmedynski marked this pull request as ready for review July 29, 2026 16:44
@paulmedynski
paulmedynski requested a review from a team as a code owner July 29, 2026 16:44
Copilot AI review requested due to automatic review settings July 29, 2026 16:44
@paulmedynski paulmedynski self-assigned this Jul 29, 2026
@paulmedynski paulmedynski moved this from To triage to In review in SqlClient Board Jul 29, 2026
@paulmedynski
paulmedynski enabled auto-merge (squash) July 29, 2026 16:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ConversionTests to consume the shared CEK from the fixture and to only drop per-test tables in Dispose().

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.

@paulmedynski

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@paulmedynski
paulmedynski merged commit 440074d into release/7.0 Jul 30, 2026
299 checks passed
@paulmedynski
paulmedynski deleted the dev/automation/pr-4478-to-7.0.3 branch July 30, 2026 17:38
@github-project-automation github-project-automation Bot moved this from In review to Done in SqlClient Board Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.72%. Comparing base (e47f4f0) to head (e87af5a).
⚠️ Report is 1 commits behind head on release/7.0.

❗ There is a different number of reports uploaded between BASE (e47f4f0) and HEAD (e87af5a). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (e47f4f0) HEAD (e87af5a)
CI-SqlClient 1 0
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     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 65.72% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants