Skip to content

Give every test fake connection a server name of its own, and fail when one is fixed - #316

Merged
electricessence merged 1 commit into
masterfrom
test/shared-tier-isolation
Dec 4, 2026
Merged

electricessence merged 1 commit into
masterfrom
test/shared-tier-isolation

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

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, 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 on #315 was one such case (#315 renamed its procedure names; this change removes the class of problem).

  • Every fake connection reports its own server name. Each now takes it from 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.
  • A guard fails when it comes back. SharedTierIsolationTests reads 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 form ParameterNameHarness.NewProcedure hands out (dbo.names followed by a number). The failure message says what is wrong and the fix. Seen failing: a fixed fake put back in one file and a dbo.names3 in another made the two checks fail; both were restored before the commit.
  • No other channel into the shared table. Shared.ByProcedure.Count is 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

…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>
@electricessence
electricessence merged commit 39ec5d7 into master Dec 4, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant