Repository navigation
Give every test fake connection a server name of its own, and fail when one is fixed - #316
Merged
Merged
Conversation
…en one is fixed
The remembered parameter names of a schema-qualified procedure are kept for the whole process, by server, database, kind of connection and procedure text. Most test fakes reported the same fixed server name ("fake", "gate", "output" and so on), so a test could find names another test had left for the same procedure text, and pass or fail by the order the tests ran in. The theory in ProcedureSchemaNamesTests that failed in CI was one such case; its names no longer collide with the ones the test helper hands out.
Each fake connection now reports a server name from NameServer.Unique. A fake that stands for one server across several connections of one test (the tracked connections of a tally, the connections of a token rig, the connections of a database rig) takes the name once for the tally or rig instead of once per connection, so what a test counts across those connections keeps its meaning. A fake that reports no server at all (the gated connection of the ConfigureAwait test) stays as it is: a connection that names no server is never shared.
A new test reads the test project's own source files and fails when a type reports a string literal as its server name (except the one allowed fake, with its reason), or when a test file uses a procedure name of the form the helper hands out (dbo.names followed by a number). The failure message says what is wrong and the fix.
Tests only: no run-time change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
The remembered parameter names of a schema-qualified procedure are kept for the whole process, by server, database, kind of connection and procedure text (#314). Most test fakes reported the same fixed server name (
fake,gate,outputand so on), so a test could find names another test had left for the same procedure text, and pass or fail by the order the tests ran in. The theory inProcedureSchemaNamesTeststhat failed in CI on #315 was one such case (#315 renamed its procedure names; this change removes the class of problem).NameServer.Unique, which already existed. A fake that stands for one server across several connections of one test (the tracked connections of a tally, the connections of a token rig, the connections of a database rig) takes the name once for the tally or rig instead of once per connection, so what a test counts across those connections keeps its meaning. A fake that reports no server at all (the gated connection of the ConfigureAwait test) stays as it is: a connection that names no server is never shared.SharedTierIsolationTestsreads the test project's own source files and fails when a type reports a string literal as its server name (except that one allowed fake, with its reason), or when a test file uses a procedure name of the formParameterNameHarness.NewProcedurehands out (dbo.namesfollowed by a number). The failure message says what is wrong and the fix. Seen failing: a fixedfakeput back in one file and adbo.names3in another made the two checks fail; both were restored before the commit.Shared.ByProcedure.Countis asserted only in the shared-tier collection, which runs alone, and the table is cleared only there.Tests only: no run-time change, no public API change.
Verification: solution Release build 0 warnings, 0 errors; Core.Tests all passed in three runs with the test classes and collections shuffled (seeds 101, 202 and 303), and in the normal gate; 267 sample checks; style and analyzer checks 0 findings; docfx 0 warnings; style scan clean; each literal of 12 or more characters this change adds appears once.
🤖 Generated with Claude Code