Skip to content

Delete Guard-stage tests that assert spelling, slice 2 (#5833) - #5842

Merged
erikdarlingdata merged 8 commits into
devfrom
fix/5833-triage-2
Oct 15, 2026
Merged

erikdarlingdata merged 8 commits into
devfrom
fix/5833-triage-2

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Claude posting for Erik Darling.

Part of #5833.

Why

The ruling on #5833 is that tests should be load bearing. A Guard-stage test that fails when correct code is spelled differently protects nothing, and it turns pull requests red. This is slice 2: 37 Darling test files. Each test method was judged on its own: KEEP if it fails on a real defect, DELETE if it fails on a correct change, TRIM a file that holds both. This PR adds no tests and changes no production code.

What changes

Counts: 6 files deleted, 18 trimmed, 13 kept (one of them is the GuardStageScanner helper). 114 [Fact]/[Theory] attributes removed in total, and 71 tools/list budget data files deleted with their ratchet. About 7,100 lines are deleted.

File Verdict The defect it fails on, or the spelling it asserted
DeltaGapPolicyTests KEEP A collector passes a hard-coded gap, which fabricates zero deltas. Perfmon intervals summed instead of MAX, which reads rates 12-17x low. One method is Undecided (below).
DesktopDatabaseFilterLiveTests TRIM Deleted TheSql_CarriesTheListFormPredicate_OnEveryNarrowedRead, which pinned SQL fragment wording; the live tests in the same file run those reads. KEEP (wiring): TheFileIoTab_PassesTheSavedFilterIntoBothTrends and TheFinOpsTab_.... Without them, a viewer tab could silently ignore the saved database filter, and no behavior test reaches a WPF tab.
DocCommentHygieneTests DELETE Doc comment structure, presence and crefs (31 methods).
EngineCapabilityMissTests KEEP A read answers unavailable instead of not_collected on Azure SQL DB, and the read wiring must match on both SKUs.
EntraProviderPackageCensusTests TRIM Deleted TheDeprecatedTree_IsExcludedAndThatExclusionMatters, which only checked an exclusion roster. Kept: a project that assigns an Entra mode but lacks the provider package fails to connect at runtime.
FactSourceRegistryTests TRIM Deleted BothDescriptions_SpellOutTheRegistry, which pinned description text. Kept: a source that is emitted or scored but not registered gets refused by the filter.
FailedSendRetryTrackerClockStepTests KEEP Behavior tests, plus a check that product code never reads the raw stamp, which would skip the clock-step clamp.
FailureNoteRedactionTests KEEP ex.Message leaking into a returned note (masking). One method is Undecided (below).
FindingsRetentionDefaultWiringPinTests TRIM Deleted TheCleanupDefaultNamesTheSharedHorizon. Its own doc says the IL is byte-identical either way, so it pins source text only. Kept: the reflection test that reads the compiled default.
FleetCardPostgresCpuTests TRIM Deleted TheOnlySurfacesThatBandCpu_AllReachTheSharedDecision (a roster; BothCpuBandingSurfaces_AgreeOnTheSameServer covers the behavior) and BothPgCpuReadsBindTheSharedFreshnessConstant (pins a constant's name). Kept: the bounded hypertable read shape, which has a known cost.
FleetIdentifierScrubTests KEEP Real tenant or server names in the published tree.
GuardStageCensusTests DELETE A trait roster (20 methods).
GuardStageScanner (helper) KEEP Lite.Tests/GuardStageCensusTests.cs still links it through Lite.Tests.csproj.
HostHeaderGuardTests TRIM Deleted 9 middleware-order and source pins plus their helper. DarlingMcpHostGateLiveTests and DarlingWebHostGateLiveTests already cover each one through the shipped pipeline: a foreign Host is refused in both modes and on /core, a TLS refusal degrades to loopback names, and the extra host name is admitted only in network mode. KEEP (wiring): McpHost_KeepsTheTransportStatelessWhileCoreIsMapped. Without it, a stateful session opened on / could call any tool on /core, and no behavior test covers that.
HypotheticalIndexSingleStatementGuardTests TRIM Deleted TheGuardIsAPredicate_SoTheTextItClearsIsNeverRewritten, which pinned a signature. KEEP (wiring): TheGuardRunsAtTheEntryPointAndAtTheSink, because without it multi-statement text could reach a monitored server and no behavior test drives the entry point. Kept TheExplainStillOnlyPlans: ANALYZE would execute monitored-server text.
LatestValueLookbackTests TRIM Deleted three tests: EachRead_BindsTheBoundOfTheCollectorWhoseTableItReads (call spelling), and TheDatabaseConfigRead_... and TheTraceFlagsRead_... (SQL wording; the live tests in the file cover both reads). Kept: the lower-bound census, since an unbounded latest-value read scans the whole hypertable, and the Lite twin parity check.
LiteReadsTraitGuardTests DELETE A Reads=Lite trait roster.
LiveClassStoreSkipCensusTests DELETE Per the coordinator's ruling: a live class that does not skip goes red on its own wherever PostgreSQL is unset.
LiveCleanupConversionRatchetTests DELETE Per the coordinator's ruling: a conversion ratchet is a style rule.
LiveClockCensusTests KEEP Per the coordinator's ruling: a block-counting live test seeded from the wall clock flakes silently at window boundaries.
LivePlanShapeIsolationCensusTests DELETE Per the coordinator's ruling: a frozen-baseline roster.
LivePostgresCollectionHygieneTests TRIM Deleted TheSweep_SkipsBuildOutputThroughTheSeparatorAwareHelper (spelling). Kept the main census: a shared-store class outside the live-postgres collection races silently.
LockedModeRestoreCoverageTests TRIM Deleted TheRawPatterns_AreReadOnlyThroughTheOneAccessor, a style rule inside the test itself. Kept: a restore that can leave locked mode lets transitive package drift through unreviewed.
McpPayloadContractCensusTests TRIM Deleted TheSixMovedSites_FetchOnePastTheCap_AndObserveThroughBoundPage and TheAutovacuumRunHistory_BindsToItsCapAndObserves (call spellings) and EveryWindowFloorTool_CarriesTheSharedClause_AndNoOtherToolDoes (a description roster). Kept: error masking, clamping instead of refusing, payload keys and values, and culture-dependent timestamp parsing.
McpServiceParameterDiSeatCensusTests KEEP (wiring) Without a DI registration, the SDK serves the parameter as a client argument, so a remote caller could set PostgresConfig.
McpToolTypeRegistrationTests KEEP An unregistered tool type means shipped reads go missing (#2659).
McpToolsListBudgetTests TRIM Deleted the three ceiling ratchets (ToolsList_TotalBytes_IsAtOrUnderTheCeiling, the per-description ceilings and the budget-file layout check), their helpers, the change-log comment and McpToolsListBudget/*.txt (71 files). Kept: no guide marker reaches the wire, D2's absolute caps, and near-miss markers.
McpUnknownArgumentGuardTests KEEP Behavior tests. KEEP (wiring): TheHost_RegistersTheUnknownArgumentGuard_AsACallToolFilter. Without it, a misspelled parameter is silently dropped; McpInProcessHost installs the filter itself, so it cannot cover the shipped host.
MeasurementContractCensusTests KEEP Division by a zero or assumed interval, and rates divided by a cadence instead of the measured interval.
NoInternalBusFilesGuardTests KEEP Internal agent-bus files published in the repository.
PasswordBindingCensusTests TRIM Deleted No_other_connection_predicate_remains_under_Darling, a one-implementation roster; Differ itself is tested by behavior. Kept: a server setting that the connection is built from but that is not bound means a stored password gets reused for a changed connection.
PeakTimeTieBreakTests TRIM Deleted TheIoPeakSample_AndItsReadCount_PickTheSameTiedRow, which pinned SQL wording. Kept the tie-break and NULLS-last census.
PgClusterObjectCensusTests TRIM Deleted two stale-roster checks (EveryAllowListEntry_StillMatches..., EveryPinnedSampleStatement_StillMatches...). Kept the collection census: changes to cluster-wide objects race silently.
PgCpuCapacityHeadroomTests TRIM Deleted four tests: the clause spelled in one place, the alert's call spelling, the alert text wording, and the MCP note wording. Kept the capacity census, the migration rung and probe, and the behavior tests.
PgDatabaseSizeStatsAndHostMemoryRungTests TRIM Deleted NoReaderNamesTheSizeTableOrTheMemoryColumnsYet, a consumer roster. Kept: the rung registration, and the probe mapping, without which a store would map one rung low.
PgExtensionDependencyContractTests KEEP A collector that touches an undeclared extension fails on a server without it.
PgSensitiveStatementFilterTests TRIM Deleted ThePatternHasExactlyOneDefinitionInTheRepo, a one-definition roster. Kept: the readers use the shared filter, otherwise statement text with passwords is stored.

Rosters outside the slice that named deleted code (fixed by deleting the dead entry, as the brief requires):

  • CommentFilterAdoptionTests: dropped the DocCommentHygieneTests.cs entry and changed its summary's count word from Eight to Seven, which its own count pin requires.
  • RepoFileAdoptionTests: dropped PgCpuCapacityHeadroomTests.cs from the LF-reading roster, because the trimmed file no longer reads LF. LockedModeRestoreCoverageTests still does, so its entry stays.

Left in place on purpose

  • GuardStageScanner.cs: Lite.Tests/GuardStageCensusTests.cs links it. Its R1-R4 parts become dead once the Lite census goes, which is another slice's work.
  • Lite.Tests/McpToolsListBudgetTests.cs and Lite.Tests/McpToolsListBudget/*.txt: Lite's twin of the ratchet deleted here. Its doc calls the two lockstep (D6), so the Lite slice should delete it too.
  • Comment-only mentions of the deleted classes, which change no behavior: .github/workflows/build.yml lines 276, 754 and 785, .github/scripts/tag-reads-lite.py line 4, and prose in about 15 test files. No production code becomes unused.

Undecided (kept; the coordinator rules)

  • DeltaGapPolicyTests.ThePerfmonCollectorMeasuresItsInterval_RatherThanAssertingTheCadence: DoesNotContain(".Value(60)") catches the real defect (a literal cadence used as the interval, rates up to 5x high). Its two Contains lines, however, pin call spellings.
  • FailureNoteRedactionTests.OnlyAnalysisContext_ConstructsOrAppendsACollectionFailure: it is motivated by masking, since it stops a second place that could write ex.Message into a failure record. But it fails on any correct new construction site; TheForcePlanReader_...NeverPutsExMessage... is the direct masking check.

Test plan

  • dotnet build Darling/Darling.Tests -c Debug: 0 warnings, 0 errors. dotnet build Lite.Tests -c Debug: 0 warnings, 0 errors.
  • CommentFilterAdoptionTests and RepoFileAdoptionTests run alone: Total: 6, Failed: 0.
  • Gate (pre-push.sh), first run before the roster fixes: Guard Darling.Tests Total: 4415, Failed: 2 (the two rosters above), Guard Lite.Tests Total: 1281, Failed: 0. Selected classes: darling 2790, lite 655, with one failure (CommentFilterAdoptionTests, the same roster).
  • Gate (pre-push.sh), final run on 4298cd3: GATE GREEN. Guard Darling.Tests Total: 4415, Errors: 0, Failed: 0, Guard Lite.Tests Total: 1281, Errors: 0, Failed: 0, classes: darling 2793, lite 657, every class run passed.
  • Live classes I trimmed (DesktopDatabaseFilterLiveTests, LatestValueLookbackTests, PgDatabaseSizeStatsAndHostMemoryRungTests): only Guard-stage methods were removed from them, and the brief says no rig. CI runs the live halves.

Guard stage, before and after: dev Darling.Tests Total: 4601 becomes Darling.Tests Total: 4415 (186 fewer), and dev Lite.Tests Total: 1281 stays Lite.Tests Total: 1281 (Lite is unchanged).

Coordinator ruling followed

  • Wiring pins: kept only where no behavior test reaches the behavior (marked KEEP (wiring)), deleted where a host or window behavior test covers it.
  • Test-hygiene censuses: kept LiveClock and LivePostgresCollectionHygiene (silent defects), deleted LiveClassStoreSkip, LiveCleanupConversion and LivePlanShapeIsolation.

SECTION: Changed
ENTRY: - Guard-stage spelling tests deleted, slice 2 ([#PR]) - 114 test methods in 24 files that asserted how code is spelled, not what it does.

CommandDeadlineScannerAdoptionTests and CommentFilterAdoptionTests are rosters
of which test pins use which helper; CollectionLogWebRowPreservesFullTextPinTests
pins one call's argument text. None fails on a product defect.
Deletes the methods that assert a call's text, a signature, a SQL fragment,
a description's wording or a roster, and the private helpers only they used.
Censuses that fail on a real defect (a missing deadline, a leaked statement,
an alert past the master switch, a Lite/Darling drift) stay.
Three doc crefs in test files and two in DarlingCloudIdentityProbe named
deleted tests; CrossAppGuardCiGateTests exempted four Lite.Tests reads that
only the deleted CommentFilterAdoptionTests and NeitherFixHasALiteTwinToDriftFrom made.
… census and keep LockedModeRestoreCoverageTests on the LF roster (#5833 slice 2)
@erikdarlingdata erikdarlingdata added the merge-train In a merge train: its CI ran on the train PR label Oct 15, 2026
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review October 15, 2026 04:33
McpToolsListBudgetTests.cs: the slice removed the tools/list byte ratchet, so dev's TotalCeilingBytes raise (#5819) goes with it; the served-shape checks stay.
CommentFilterAdoptionTests.cs: deleted by slice 1, trimmed by slice 2 (its DocCommentHygieneTests entry). The deletion stands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-train In a merge train: its CI ran on the train PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant