Repository navigation
sp_QuickieStore tests: fix check counts in the README (MultiDb flake already fixed) - #958
Merged
Merged
Conversation
…line for --only multidb The README said 397 checks in one place and "Expect 364 / 365 on 2017" in another. The real counts from a green CI run on dev (b7fba0f) are 397 on SQL Server 2022 and 2025, 396 on 2017 and 395 on 2019; the README now says so and explains why the count changes with the version. --only multidb now prints a "Total: N passed, M failed" line, like --only plan_parsing, so repeated runs of the group can be counted. The MultiDb "both databases return their queries" flake from 2026-10-23 is already fixed on dev by ea8cf0c (markers folded by simple parameterization, not a Query Store flush race), and every fixture already flushes, so no fixture change is made here. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M98owc3zzZNEpij3p49Bbe
erikdarlingdata
marked this pull request as ready for review
November 13, 2026 09:01
|
Claude finished @erikdarlingdata's task in 10s —— View job ReviewThe change is small and looks good. It touches test files only, with no procedure, version, or
I didn't re-run the harness. I only read the diff, and the CI-run numbers come from the PR description. No issues to flag. |
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.
What this changes
Test files only (
sp_QuickieStore/tests/README.md,sp_QuickieStore/tests/run_tests.py). No procedure change, no version change.1. Multi-database flake ("both databases return their queries"): already fixed, no fixture change
Re-check result: the finding no longer holds on dev, and its premise (a Query Store flush race) was never the cause.
I read the job logs of all 11 failed SQL Tests runs from 2026-10-14 to 2026-11-13 (
gh api .../jobs/<id>/logs, grepping[FAIL]). The check failed in two runs, both on 2026-10-23, on SQL Server 2022 and 2025 only:runtime_stats rows=6(2025),rows=3(2022)runtime_stats rows=0(2022 and 2025)Both runs are older than
ea8cf0c6(2026-10-23 13:50 EDT, in dev), which fixed it. That commit found the cause: simple parameterization foldedmd_q1tomd_q3into one query and dropped the comments, so each database held fewer distinct queries than the check expects. It was not a flush miss.I confirmed this by replaying the pre-fix harness (
eace0d19) against today's procedure on SQL2022 and SQL2025, 3 runs each:rows=6and a failure every time (6 of 6). The current harness passes the same check every time (below). A flush race would not give the same count on every run.The fixture already does what the finding asked for:
MD_QUERIES_SQLends withEXECUTE sys.sp_query_store_flush_db;in each fixture database, after the workload and before any read.md_build_databasethen probes that every marker has a query, a plan and runtime stats, reruns up to 5 times (clearing the plan cache each time), and acaptured every marker querycheck names any miss.Other checks with the same read-after-workload pattern: every fixture group already flushes after its workload (main fixture lines 256 and 308, MultiDb 664, regression fixture 1371 and 1426, regression window 1872, plan parsing 2905, last values 3453 and 3508). None needs the treatment.
Proof on current dev (origin/dev b7fba0f),
python run_tests.py --server <S> --only multidb, 6 runs per server:Total: 20 passed, 0 failed.Total: 20 passed, 0 failed.both databases return their queriesreturned 11 to 14 runtime_stats rows in all 12 runs (needs 8). No failures.[FAIL]line.Every failed run from the last month, by cause (none is an open flake):
WaitFloor[6001]: LCK_M_IS ... does not surfaceea8cf0c6.PlanParsingrules 1, 2, 4, 5, 8, 18, and rule 3 (UDF) on 2019@plan_parsingPR was being built, then fixed in that PR (rule 3:2dcbb025).subprocess.TimeoutExpiredon 2022 and 2025@end_datetest, fixed in2729d75b.The 5 dev push runs since 2026-11-13 05:59 UTC are all green.
2. README check counts (docs)
The README said
397in one place andExpect 364 / 365 on 2017in another. Counts from the last green dev push run (43389980095),Results:line of the sp_QuickieStore step in each job:My own full runs agree for 2022 and 2025 (397 total each). The README now gives these four numbers and the reasons they differ: two permission checks run only on 2022 and later, the rule 14 check at compatibility level 150 and up does not run on 2017, and 2017 runs two more rule 1 checks. (2019 = 395; 2022 = 395 + 2; 2017 = 395 - 1 + 2.) The plain-English checker shows no hits on the lines I changed.
3. Small addition:
--only multidbprints a Total line--only plan_parsingends withTotal: N passed, M failed;--only multidbprinted nothing, so repeated runs could not be counted from the output. It now prints the same line.Full harness runs (once, at the end, on the final harness)
Results: 397 passed, 0 failed, 397 total, run twice.396 passed, 1 failed, 397 total, run twice, same single failure:WaitWindow: resource_stats has one row per query (query_id values: ['7', '9']). A third run with a debug driver also failed the matchingRegressioncheck.The SQL2022 failure is the lab server, not this change or CI.
resource_statsis read fromsys.dm_exec_query_stats, so a fixture query's plan has to still be in the plan cache. The lab SQL2022 instance sees 1 GB of physical memory (target 625 MB, plan cache about 26 MB), so the likely cause is plan cache eviction:rm_q3had no cached plan at the read, and a query of the cache right after the run held onlyrm_q1. SQL2025 here and the CI containers keep the plans. Check 43389980095 is green on 2022.Dropped, and considered, not added
resource_stats has one row per queryindependent of the plan cache. The only failure is a memory-starved lab instance; CI has never failed on it. If that instance becomes a target, the fix is to run each fixture procedure once just before the read.ea8cf0c6(3 weeks, 12 of 12 local runs).--only multidband--only plan_parsingthe PASS lines print their detail text (for example(skipped list missing from the footer)next to a PASS). It is only noise.Lab cleanup: no
quickiestore_test*databases or logins remain on SQL2022 or SQL2025.sp_QuickieStorein master on both servers is the origin/dev copy.🤖 Generated with Claude Code
https://claude.ai/code/session_01M98owc3zzZNEpij3p49Bbe