Repository navigation
Cover the MCP Query Store regression reader's baseline lower bound in the census guard (#4310) - #4375
Merged
Conversation
… the census guard (#4310) Pins DarlingQueryStoreRegressionReader.QueryStoreRegressionsSql's and RegressionCoverageSql's fixed-baseline-lookback lower bound (collection_time >= $6 / $4) and its BaselineLookbackDays constant, matching the assertions the grid's ViewerQueryStoreRegressionsTests already carry for its own copy. Test-only.
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.
Refs #4310.
Why
The #4310 census found
DarlingQueryStoreRegressionReader.cs(the MCP twin of the viewer'sViewerDataService.QueryStoreRegressions.cs) was not covered by the census guard: the grid's owncopy of the read has tests pinning the #4217 fixed-baseline-lookback lower bound
(
ViewerQueryStoreRegressionsTests.RegressionsSql_SplitsBaselineBeforeWindow_RecentInWindow_OverTheBaseTableasserts
collection_time >= $5) and pinsBaselineLookbackDays == 7(
BaselineLookbackDays_IsSevenDays_SameAsTheMcpReaderAndLite). The MCP reader's existing test file(
DarlingQueryStoreRegressionsTests.cs) had a same-shaped test(
RegressionsSql_SplitsBaselineFromRecent_OnTheSameBoundary) that asserted only the window split(
collection_time < $2/>= $2/<= $3) and never asserted the baseline's own fixed lower bound(
collection_time >= $6), nor did any test pin the reader's ownBaselineLookbackDaysconstant. Thecoverage probe (
RegressionCoverageSql) had the same gap on itscollection_time >= $4baseline bound.Checked the product code first: both bounds are already present in
DarlingQueryStoreRegressionReader.cs(collection_time >= $6at line 114,collection_time >= $4at line 228) andBaselineLookbackDays = 7is already declared. This is amissing-guard defect, not a product defect — nothing was un-fixing; the ruling in the brief (the
grid's 7-day baseline bound stands for both copies) applies directly, so I added the assertions
rather than filing a product issue.
What changes (test-only)
Darling/Darling.Tests/DarlingQueryStoreRegressionsTests.cs:RegressionsSql_SplitsBaselineFromRecent_OnTheSameBoundarynow also assertscollection_time >= $6(the fixed baseline lower bound).BaselineLookbackDays_IsSevenDays_SameAsTheViewerAndLitepinsDarlingQueryStoreRegressionReader.BaselineLookbackDays == 7, mirroring the grid's own pin.CoverageSql_ProbesTheSameTable_ForBaselineAndRecentnow also assertscollection_time >= $4on the coverage probe's baseline arm.
No product code touched.
Test plan
dotnet build Darling/Darling.Tests/Darling.Tests.csproj -p:EnableWindowsTargeting=true: 0warnings, 0 errors.
dotnet build Lite.Tests/Lite.Tests.csproj -p:EnableWindowsTargeting=true: 0 warnings, 0 errors.temporarily replaced line 114 (
AND collection_time >= $6) inDarlingQueryStoreRegressionReader.cswith a comment placeholder and confirmedgrep -q "collection_time >= \$6"fails against the mutated file — i.e. the new assertion inRegressionsSql_SplitsBaselineFromRecent_OnTheSameBoundarywould fail (RED) if the reader'sfixed baseline bound were ever removed. Restored the file immediately after (verified via diff
that the reader source is unchanged from origin/dev). The same reasoning applies symmetrically
to the
BaselineLookbackDayspin and the coverage-probe's$4bound: each is a literalAssert.Contains/Assert.Equalagainst a fixed string/value that is only present in the current,already-fixed (get_query_store_regressions' baseline is every retained row before the window (no lower bound): 5–9 s per call on a large store, the slowest read on the web Queries tab #4195/WPF desktop viewer's Query Store Regressions grid still has an unbounded baseline (#4195 twin) #4217) source.
CI decides it.
For the coordinator
Test-only change, no CHANGELOG entry. Branch
fix/4310-census-guard-mcp-regressions, headda76a2913cef2030faa22ee74d7a82839fd68d20, pushed to origin. Ready for a PR to be opened (draft).