Repository navigation
Make non-shared query test store names unique per test class - #39551
Merged
AndriySvyryd merged 1 commit intoNov 13, 2026
Merged
Conversation
Non-shared query tests used Fixture.StoreName + "_NonShared" as the database name. Many fixtures share a StoreName (e.g. "ManyToManyQueryTest"), and each test class gets its own fixture instance, so classes running in parallel cleaned, recreated and seeded the same database. This caused intermittent failures such as "no such table: ManyM_DB", leftover seed rows (8 instead of 2) and unexpected identity values. Include the test class name in the store name so each class has its own database. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change that isolates non-shared query test databases by test class.
No open issues 🎉
What changed in this PR
This PR isolates non-shared query test databases by test class, preventing parallel classes with the same fixture store name from interfering with each other.
Changes:
- Adds the runtime test class name to
NonSharedStoreName, preserving the fixture name and_NonSharedsuffix.
| File | Description |
|---|---|
test/EFCore.Specification.Tests/Query/QueryTestBase.cs |
Includes the test class name in non-shared store names to avoid cross-class database collisions. |
Review effort: Balanced
AndriySvyryd
approved these changes
Nov 13, 2026
AndriySvyryd
left a comment
Member
There was a problem hiding this comment.
Thanks for your contribution!
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.
Non-shared query tests used Fixture.StoreName + "_NonShared" as the database name. Many fixtures share a StoreName (e.g. "ManyToManyQueryTest"), and each test class gets its own fixture instance, so classes running in parallel cleaned, recreated and seeded the same database. This caused intermittent failures such as "no such table: ManyM_DB", leftover seed rows (8 instead of 2) and unexpected identity values.
Include the test class name in the store name so each class has its own database.