Repository navigation
Flaky test classes: the statement filter tests no longer depend on the runner's speed (Refs #5459) - #5504
Merged
Conversation
… over-budget path has its own test (#5459) AlertStatementFilter gets a test seam for the per-call JudgeBudget (AsyncLocal, same default). The 4 MB report tests no longer depend on the runner's speed.
…l start (#5459) The holder lived 30 s, so a PowerShell 5.1 that started cold on a loaded runner could poll after it was gone and find nothing to refuse on.
…second of lock contention to pass (Refs #5459) RunMemoryTrimCycle skips silently when another test holds the process-wide database lock. The test re-ran it 20 times 50 ms apart, which is still a one-second budget: a hold of three seconds reproduces the CI numbers (before and after both 105906176). The test now waits on CompletedTrimCycleCount, which moves only after both SET statements ran, with a 30 s hang backstop, and measures once after a cycle that ran.
…loaded runner cannot undercount them (Refs #5459) Burn() spun for 40 ms of wall clock, so a descheduled thread charged less than 40 ms of CPU and two burns could add up to 46 ms against a 50 ms lower bound. It now spins until the thread's own CPU counter has advanced by the burn.
… of a fixed sleep before counting scans (Refs #5459) The short-window round-trip test read the wide table's scan counters after flushing only its own connection and whichever pooled connection the pool returned, then waited a fixed 1.1 s for the viewer's backend. The seeding data source and the viewer are now closed and their backends waited out, since a backend reports what it has pending as it exits. Test-only.
… the statement filter's slow-judge and three-incident tests run on a stepped budget clock (Refs #5459) TestCpuAccountantTests: the idle side of two tests was bounded under 10 ms, below the 15.6 ms step of the thread CPU counter, so one clock interrupt landing on a waiting thread failed it. The bound is now two counter ticks (measured in the test) against a busy side that burns at least four, with a planted stray-tick test. StatementFilterAlertTests: a stepped budget clock replaces the real clock in the slow-judge test, and a new test proves the over-budget path withholds a report whole while the accounting the three-incident test reads is unchanged.
…oaded runner cannot spend the wall-clock budget; a spent session has its own test (Refs #5459) CollectorContext gets an internal ScrubSessionFactory test seam; production never sets it, so every read still gets new Session(). The worst-case read (200 plans and one 27 MB plan) now runs under a one-hour budget and must judge all 201 plans; a new test runs the same read under a spent budget and expects every plan withheld whole. The 20 s wall bound is a 2 minute hang backstop.
erikdarlingdata
marked this pull request as ready for review
October 8, 2026 03:06
Merged
9 of 10 tasks
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 #5459
Four lanes work this branch. A takes the classes that need no database, B the PostgreSQL live classes, C the Lite classes, and D the timing flakes the others left. Each lane adds its rows to the class table. Users see no change. The product code gains two test seams with the same default.
SECTION: None
Class table
AlertStatementFiltergets an internalUseBudgetseam (AsyncLocal). The default is unchanged. The 4 MB tests pin a one-hour budget. Two new tests hand the filter a spent budget and expect everything withheld unjudged.WaitForExitAsyncreturn without looking at an already-cancelled token.Directory.Movemet a sharing violation on Windows.MoveDirectoryOnceReleasedretries for up to 10 s.MoveDirectoryOnceReleasedTests3 of 3. The real-runtime test passed on an extracted runtime.DeployPowerShellProbeLimitTests.InRange(x, 23, 0)can never pass.RunMemoryTrimCycleskips silently when another test holds the process-wide lock. The test re-ran it for one second only.CompletedTrimCycleCount, which moves only after a cycle really ran, with a 30 s hang backstop.Burn()spun for 40 ms of wall clock, but the accountant charges thread CPU time. A descheduled thread charges less.Burn()spins until the thread's own CPU counter moves by the burn.GetThreadTimesmoves in ticks of about 15.6 ms. The idle side was bounded under 10 ms, below one tick. One clock interrupt landing on a waiting thread read as 15 ms and failedTwo_tests_in_parallel_are_charged_separately. The unflowed-work test has the same shape.took < 1950 mson the real clock. A runner that stalls for a moment fails it though the budget logic is fine.< 20 s.CollectorContextgets an internalScrubSessionFactoryseam, null by default. The test pins an hour-long session and expects all 201 plans judged and none withheld. A new test runs a spent session and expects all 201 withheld. The wall bound is a 2 minute hang backstop.DeployPowerShellProbeLimitTestspins it for this file too.pg_settings.settingin milliseconds. The second has no failing sample to trace.pg_ls_logdir()reports modification in whole seconds. The two files tied and the tail read the outgoing one.Already fixed on the base (the failing message matches the fixed cause)
Not class flakes
timescaledb_information.continuous_aggregateswas missing (7 classes). It was one PR's own migration defect, fixed in that PR.Product code changed
PerformanceMonitor.Alerting/AlertStatementFilter.cs:NewBudget()replaces the fournew JudgeBudget(ReadBudget)sites.UseBudget(internal, AsyncLocal) is the test seam.PerformanceMonitor.Collectors/CollectorContext.cs(lane D):BeginStatementScrub()usesScrubSessionFactory?.Invoke() ?? new SensitiveStatements.Session(). The property is internal and null in production.Test plan
-trait Stage=Guard -failSkips: Darling.Tests 1372/0, Lite.Tests 372/0.Handoff
Lane D finished all six items. One thing is left alone.
DarlingEncryptPasswordStreamTestshas no planted slow start, because that needs a hold of over a minute. The pin proves the limit, and the cause stands by elimination.Lane A and lane B had nothing left. Lane B dropped a speculative change to the wide-grid class because a planted stray backend did not fail the head. If that class fails again, check for a pooled backend with a pending scan.