Repository navigation
fix(#6260): a wall-clock bound measures the code, not the JVM's stop-the-world pauses - #6268
Conversation
…the-world pauses (#6260) Two engine tests went red in a full-suite run while behaving correctly: AsyncShutdownDrainTest.closeDoesNotHangOnAWedgedAsyncWorker measured 27,396ms for a close() bounded by a 1s timeout plus a 2s join, and Issue6199DrainWakeupTest.theResidualDrainKeepsItsHardDeadline measured 24,143ms for a wait bounded by 200ms. Late in a 12,000-test single-JVM run a stop-the-world pause of tens of seconds is not exotic, and any bound with less headroom than that is a coin flip on the JVM's mood. Widening the numbers was not available as a fix. Several of these bounds are discriminating a single shared 200ms deadline from ten independent per-row ones, so they have to stay below 2s to mean anything at all; widening them deletes the assertion. Instead the measurement itself is corrected: a daemon sampler parks for 10ms at a time and accumulates however much longer each park actually took, so the difference of two readings is the JVM-wide stall inside that interval. Subtracting it leaves the time the JVM was actually running, which keeps every bound exactly as tight as it was and immune to the pause. Deliberately not discounted: time the measured thread spends sleeping, parked or blocked. The sampler keeps ticking then, so a test that waits a second is still charged a second - only a stall that also stops the sampler is taken out. The sampler runs at default priority on purpose, so it suffers the same CPU starvation the measured thread does; that half of the problem is invisible to a GC-pause-only view. The two assertion methods differ only in their failure message, and that is the point: the message has to say what the number is for, so the next person to see it go red knows whether loosening it is a repair or a cover-up. - assertGaveUpWithin - the bound is a tripwire between a bounded operation and an unbounded one. Generous is free; a wider bound cannot turn a passing run red - assertStayedUnder - the bound IS the assertion, standing in for a complexity claim with no other practical expression. Loosening it deletes the test Applied across the engine suite: 40 elapsed-time assertions in 26 test classes. Lower bounds (isGreaterThan) and short waits expected to time out are left alone - a stall only makes those more true - and the two isBetween sites are split so the floor keeps reading raw wall clock while only the ceiling is discounted. Issue5587's gap-ratio comparison samples the stall counter alongside each timestamp, so a pause landing in one half cannot skew it. Three @timeout(30) annotations on tests whose own budget is already 16s or more are raised to 120s: JUnit's timeout is plain wall clock and cannot be discounted, so it has to be sized as a hang detector rather than as a latency bound.
|
Tick the box to add this pull request to the merge queue (same as
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | ✅ -6.56% coverage variation |
| Diff coverage | ✅ ∅ diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (4359848) 158758 125225 78.88% Head commit (70eb144) 191111 (+32353) 138200 (+12975) 72.31% (-6.56%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#6268) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Review: PR #6268, StallAwareStopwatch for flaky wall-clock test bounds. Nice piece of engineering. The problem statement (a 24 to 30 second stop-the-world pause tripping sub-15s bounds late in a 12k-test single-JVM run) is well diagnosed, and the fix addresses the actual measurement rather than just widening numbers, which the PR correctly argues would silently delete several of the assertStayedUnder-style complexity assertions (for example, one shared 200ms deadline vs ten independent ones cannot tolerate a 2s bound). Scope check: every changed file is under */src/test/java plus the CLAUDE.md doc addition, so no production code is touched and there is no runtime performance, GC, or security surface here. No new dependencies. Design (JvmStallMonitor / StallAwareStopwatch):
Inherent tradeoff worth flagging (not a bug, just calling it out for the record): Test coverage: Nits:
Overall: solid fix, correctly scoped to test code, with good self-testing. No blocking issues found. |
…oor is, and why check() reads in that order Review follow-ups, all documentation - no behaviour change. - check() takes two non-atomic snapshots, and the order is load-bearing: sampling the stall AFTER the elapsed time means the stall window can only be wider than the elapsed one, so the discount can only come out too generous. Read the other way round it could come out too small and fail a run that was fine. - The sampler is a daemon with no stop path on purpose, because a test JVM's life is the whole window anyone can measure. Said so, so anything longer-lived that wants to reuse it knows it needs a shutdown story first. - The sensitivity the design trades away, written down rather than left to be rediscovered: the monitor cannot tell a stall from the measured thread's own work being slow on an oversubscribed box, so on a loaded runner a genuine regression can be discounted along with the noise. That is the deliberate trade, and it is why assertStayedUnder bounds want an order of magnitude of headroom rather than being tuned down to whatever currently passes. - Nothing below tick + tolerance is ever discounted, so a bound tighter than ~20ms gets no help. Only PaginatedSparseVectorEngineBackpressureTest (50ms) is anywhere near that floor; noted it as the first place to look if it flakes, and what lowering the tolerance would cost every other measurement.
ReviewThis is a well-designed fix for genuine flaky-test infrastructure: a daemon sampler ( Correctness
One gap worth flagging
Style/consistencyAcross the ~30 call sites, the choice between Performance / securityTest-only code under Test coverageGood — the new Overall: solid fix, addresses a real problem with a principled mechanism rather than a blanket widen, and the CLAUDE.md addition captures the decision rule well for future contributors. The |
…-name grep never saw Issue6199DrainWakeupTest.theResidualDrainKeepsItsHardDeadline is one of the two failures #6260 was filed on, and it was the one site still carrying the fix this PR argues against: #6223 had widened its bound to a flat 1 minute to survive the pause. That is fine as far as it goes - a tripwire has room to be widened - but leaving it there means the motivating repro is not actually running through the mechanism built to handle it. It now discounts the stall like everything else, which lets the tripwire come back down from 60s to 5s: still far above the honest ~200ms, still far below the forever an unbounded wait takes. Finding it exposed a hole in how the other 40 were located. The original sweep matched `assertThat(elapsed...)`, so every site that asserts on the expression inline, or names the variable something else, was invisible to it. Re-swept on `System.currentTimeMillis() - <anything>` instead, which turns up three more real bounds among the benchmarks and printlns: - AsyncWedgedWorkerStallTest - the backstop fires on the configured no-progress bound rather than waiting out the wedge. A tripwire - Issue6200PerDatabaseDeferredBacklogTest - a database that is not suspended returns at once instead of waiting on another database's over-cap backlog. The bound IS the assertion: it is the whole difference between per-database and global backlog accounting - WithAndUnwindTest - ~200 comparisons per UNWIND row with the predicate pushdown, not 200*200 without it Left alone, as before: lower bounds (SQLScriptTest, SleepStatementExecutionTest, CodeUtilsTest), which a stall only makes more true, and the @tag("benchmark") classes, which are not in a CI lane.
Review of #6268Overall this is a well-engineered fix for a real problem (flaky wall-clock assertions in a shared-JVM, 12k-test run), and the PR description does an unusually good job of explaining the design rationale up front. Notes below after reading through Design / code quality
Worth a second look (not blocking, just flagging)
VerificationI wasn't able to run Test coverageGood - the new utility has direct unit coverage, and the fix is validated against the exact reported failure mode (injected 24s stall) rather than only via the much less reliable real stop-the-world repro. The Nice work overall - the reasoning for why widening bounds wasn't an acceptable fix (the shared-deadline-vs-per-row-budget tests) is the right call, and fixing the measurement instead of the numbers is the correct level to solve this at. |
…pwire Review point, and it is right: LSMVectorIndexRebuildTest's "search must not block on the async rebuild" was the one assertGaveUpWithin in the set where nothing actually gives up. The rule the two method names encode is that a tripwire separates a bounded operation from an unbounded one, and the thing it separates here is a search served from the graph it already has from one that waits for a rebuild - both finite, and the bound is the whole claim. That makes it assertStayedUnder, which also lines it up with how every other "must not wait on background work" assertion in the diff is categorized. Also drops a dead local the same review asked to check for: WithAndUnwindTest timed the inline-property path into inlineTimeMs and never asserted on it. It predates this PR, but it sat in the method just converted and was the last raw wall-clock measurement left there, so it went with the rest.
|
Third review addressed. Point 2 ( Point 4 (tracking issue for the other modules) - filed as #6270, covering the six sites in Dead-locals check you asked for before merge - swept every changed file for locals and imports orphaned by the conversion. One hit: Point 1 ( Point 3 ( |
Review:
|
…ctor like its three siblings Review point, and correct: this test's assertion was converted to a stall-discounted 10s bound but its @timeout(30) was left behind, which makes it the one place in the diff that still flakes on exactly the mechanism this PR exists to remove. Against ~1-2s of honest work (a 50ms x 12-window backstop plus a couple of latches), a 24s pause lands the total at ~26s and a 27s one puts it over. Raised to 120s, the same rule the other three follow. Not swept wholesale, deliberately. There are ~20 more @timeout annotations in the engine suite under 45s, and bumping them all would be the blanket widening this PR argues against: several of them ARE the assertion rather than a hang detector - RangeFunctionTest's 5s bounds are the GHSA-xmjm range() guard, where the whole claim is that the call returns rather than materialising the range. Deciding which is which is the same per-assertion classification pass this PR did for elapsed-time bounds, and it belongs with the rest of that work in #6270 rather than as an untested blind bump here.
|
Reviewed the full diff (new Correctness
Test coverage Minor/non-blocking nits
I did not have a way to run Nice work on the depth of the documentation here - the class Javadocs and per-assertion messages do a good job of preventing the exact failure mode this PR is designed to prevent (someone "fixing" a red run by blindly loosening a number). |
|
Fifth review: no blocking issues, three non-blocking nits. Answering them rather than changing anything.
The ~20 ms floor / On the unverifiable claim: the "12,093 tests, 0 failures" figure is |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6268 +/- ##
==========================================
- Coverage 70.11% 70.11% -0.01%
==========================================
Files 1838 1838
Lines 158758 158758
Branches 33489 33489
==========================================
- Hits 111318 111312 -6
+ Misses 33572 33570 -2
- Partials 13868 13876 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…t wrote, a warning that speaks again, and bounds that say what they are for (#6307) Four test-hygiene follow-ups from #6267 / #6268, fixed together. #6297 (1) - the teardown resolved its paths from a configuration it had just reset. BaseGraphServerTest.endTest() called GlobalConfiguration.resetAll() before the cleanup, and every path TestServerHelper.deleteDatabaseFolders() deletes is resolved at call time from SERVER_DATABASE_DIRECTORY, whose default is ${arcadedb.server.rootPath}/databases over a root path that defaults to null and resolves to the empty string. So the cleanup deleted /databases0 while the test's own ./target/databases0 - and the .raft-storage under it - survived. The reset now runs last, inside a finally that also covers the deletes so a failing checkDatabasesAreIdentical no longer skips them; StaticBaseServerTest.beginTest configures before it cleans for the same reason; and a guard refuses a path that did not resolve, so a future reordering degrades to a logged no-op rather than a recursive delete at the filesystem root. #6297 (2) - the ambiguity warnings no longer go permanently quiet. The warn-once latches are replaced by the rendered collision list itself, so any change to the verdict is reported and an unchanged verdict stays quiet whatever the cluster did in between. Both callers now hand over every resolved view, ambiguous or not: a clean pass is the only thing that clears the memory, and guarding on "is it ambiguous now?" left the stored verdict outliving the collision it described - so the same collision, reintroduced after the operator fixed it, compared equal and was logged nowhere. That gap covered HTTPS too, since only getPeerHttpEndpoints was unconditional and only for HTTP. Items (3) and (4) of #6297 stay as tracking entries: the next cut of RESYNC_RETRY_TIMEOUT_MS needs runs at the new report threshold before there is a number to choose, and isolating the heavy HA ITs into their own fork is a CI-lane change whose regression signal is a series of full-suite runs, not a test. #6280 - OpenCypherCountOptimizationTest could not see the count push-down regress: a full type scan returns the same count, just slower. EXPLAIN does route through the openCypher engine and does describe the push-down, so the six assertions commented out behind a TODO are restored against it, and the alias, empty-type and polymorphic cases get one too. #6279 - issue3216_performanceComparisonMatchStrategies asserted only that two elapsed times were not negative. Its premise was also obsolete: extractIdFilter lifts an ID(x) = <literal|parameter> equality into the MatchNodeStep at plan time, which is what #3216 was closed on, and it applies to the single-MATCH form exactly as to the split one. MatchNodeStep.prettyPrint now names the RID it was given, so the test asserts the structural property - neither form scans - with a control query the push-down cannot serve. #6270 - the wall-clock pass done for the engine suite in #6268, applied to server and network: four bounds separating a bounded operation from an unbounded one now measure through StallAwareStopwatch. HTTPAuthSessionIT needed nothing - its two sites are a lower bound and a field-presence check. The @timeout classification pass covers the engine annotations at 45s or under: they are hang detectors whose claim is carried by a structural assertion, so they are sized clear of an honest budget plus a stall, except the genuine laziness claims which are asserted on the discounted clock with the annotation left behind them. The stall sampler is renamed out of the engine's thread namespace so a leak detector cannot mistake it for engine machinery. Closes #6297 Closes #6280 Closes #6279 Closes #6270
…t wrote, a warning that speaks again, and bounds that say what they are for (#6307) * fix(#6297, #6280, #6279, #6270): a teardown that deletes what the test wrote, a warning that speaks again, and bounds that say what they are for Four test-hygiene follow-ups from #6267/#6268, fixed together. #6297 - the teardown resolved its paths from a configuration it had just reset. BaseGraphServerTest.endTest() called GlobalConfiguration.resetAll() before the cleanup, and every path TestServerHelper.deleteDatabaseFolders() deletes is resolved at call time from SERVER_DATABASE_DIRECTORY, whose default is ${arcadedb.server.rootPath}/databases over a root path that defaults to null and resolves to the empty string. So the cleanup deleted /databases0 while the test's own ./target/databases0 - and the .raft-storage under it - survived. The reset now runs last, in a finally that also covers the deletes so a failing checkDatabasesAreIdentical no longer skips them, and StaticBaseServerTest.beginTest configures before it cleans for the same reason. A guard in deleteDatabaseFolders refuses a path that did not resolve (blank, or an absolute one naming a single root-level folder), so a future reordering degrades to a logged no-op instead of a recursive delete at the filesystem root. Also #6297: the ambiguity warnings no longer go permanently quiet. A "log this once" latch is right until the operator acts on it - they declare the two ports it named, a different pair collides, and nothing is logged because the latch is spent. The latches are replaced by the rendered collision list itself, so any change to the verdict is reported and an unchanged verdict stays quiet whatever the cluster did in between; a clean pass clears the memory so a reintroduced misconfiguration is announced again. The routing warning now names the peers that collided, like its peer-to-peer twin already did. #6280 - OpenCypherCountOptimizationTest could not see the count push-down regress: a full type scan returns the same count, just slower. EXPLAIN does route through the openCypher engine and does describe the push-down, so the six assertions commented out behind a TODO are restored against it, and the alias, empty-type and polymorphic cases get one too. #6279 - issue3216_performanceComparisonMatchStrategies asserted only that two elapsed times were not negative. Its premise is also obsolete: extractIdFilter lifts an ID(x) = <literal|parameter> equality into the MatchNodeStep at plan time, which is what #3216 was closed on, and it applies to the single-MATCH form exactly as to the split one. MatchNodeStep.prettyPrint now names the RID it was given, so the test asserts the structural property - neither form scans - with a control query the push-down cannot serve. Off the benchmark lane, since it no longer times anything. #6270 - the wall-clock pass done for the engine suite in #6268, applied to server and network: four bounds separating a bounded operation from an unbounded one now measure through StallAwareStopwatch. HTTPAuthSessionIT needed nothing - its two sites are a lower bound and a field-presence check. The @timeout classification pass covers the ~20 engine annotations at 45s or under: all of them are hang detectors whose claim is carried by a structural assertion, so they are sized clear of an honest budget plus a stall, except the two laziness claims which are now asserted on the discounted clock with the annotation left behind them as the hang detector. The stall sampler is also renamed out of the engine's thread namespace so a leak detector cannot mistake it for engine machinery. * review: collapse the duplicated teardown cleanup, and say why the verdict update is not a CAS loop Both from the code review on #6307, both non-blocking. BaseGraphServerTest.endTest() called the instance deleteDatabaseFolders() and then repeated the two TestServerHelper calls it already ends in - a second recursive walk of folders that were just removed, on every server test. It was unconditional because the instance method is not: the folders go whether or not the databases were dropped. Made that explicit as the else branch instead, which keeps the semantics and does the work once. The two overrides that exist reach the same calls through super. RaftHAServer.isNewAmbiguityVerdict uses getAndSet rather than a compareAndSet loop on purpose: two threads with two DIFFERENT verdicts both logging is a duplicate warning about a misconfiguration that really did change, and a CAS loop would only pick which one the operator never hears about. * review: the guard checks the path it is about to delete, not the prefix of it Second review round on #6307, non-blocking. deleteResolvedFolder validated only the prefix argument, so the verdict rested on an assumption about the other one - that appending a digit and a separator can neither make a relative path absolute nor change its segment count. True today, and a precondition a future caller has no way to know it must preserve. Checking the concatenation has none. Same verdicts on every path the callers actually produce, now including the ones the new cases pin: '/databases0/' still refused, a root path that collapsed to '/' refused for its replication folder too. * review: skip the renderer on a clean pass, and record the two couplings that stay Third review round on #6307, all three points non-blocking. describeAmbiguity built a StringBuilder before discovering the collision map was empty, which is the common case on a correctly declared cluster and the one getPeerHttpEndpoints() asks about on every request. Returns early instead. The engine test-jar is a package-phase artifact, so 'mvn -pl server test' without -am resolves it from ~/.m2 and can run against a stale one - the trap CLAUDE.md already documents for arcadedb-gremlin-it. Noted next to the dependency in both poms rather than left for the next person to rediscover. The endTest() else branch cannot go through the overridable deleteDatabaseFolders(), because that drops the databases first and the branch exists precisely for a class that asked it not to. Verified no current class combines the two: the only override of dropDatabasesAtTheEnd() returning false (ServerReadOnlyDatabasesIT) does not override deleteDatabaseFolders(), and the two that do (BaseRaftHATest, RaftStorageDirectoryIT) inherit true. Written down at the call site. * fix(#6297): the callers have to hand over the clean passes too, or the memory never clears Real bug found by the fourth review round on #6307, and it defeated half of what #6297 (2) was for. isNewAmbiguityVerdict clears the memory when a pass finds no collision - that is what makes a fixed-and-reintroduced misconfiguration get reported again. But both callers consulted the warning only when the CURRENT view was already ambiguous, so a clean pass never reached it. The stored verdict outlived the collision it described, and the identical collision coming back later compared equal and was logged nowhere. getRoutingTable now warns unconditionally. So does unambiguousPeerAddress, which had the same gap one layer down and is why it applied to HTTPS as well: getPeerHttpEndpoints already hands over every HTTP view, so the HTTP memory was being cleared by accident of that one caller, while the HTTPS memory - reachable only through the per-peer accessor - had nothing clearing it at all. Warning from a pass where the peer asked about is fine but others collide also matches what the line already claims to be: a report of every collision the pass found, not of the one address the caller asked about. getRoutingTable's body is split into routingTableFor(protocol, leaderId) so the wiring can be driven without a live Ratis division - getLeaderId() answers null until one exists, which is before the warn path is reached, so nothing could otherwise exercise the clean half. Both new tests were confirmed red against the guarded callers: the reintroduced collision logs nothing, expected 2 actual 1. * fix(#6270): the laziness bound was wrapped around an O(n) IN, so it asserted the walk CI caught it: hugeRangeIsLazyWhenTheLimitIsDisabled measured 20,570 ms with 0 ms of JVM stall - not a pause, 20 seconds of real work - against the 10 s bound this PR put around all three queries. The premise was wrong, not the number. size() and indexing really are answered from start, step and size alone: 8 ms and 1 ms measured. IN is not. InExpression.evaluateTernary walks the list element by element, and has to, because Cypher's three-valued logic makes a null anywhere in the list turn a non-match into null rather than false - something List.contains cannot report, so it cannot delegate to LongRangeList's O(1) contains(). That walk is O(n) whether the range is lazy or not, 3 s locally and 20 s on a CI runner for an element near the end, and a bound around it was measuring the walk rather than the claim. So the window now covers the two reads that carry the claim, at a bound five times tighter than the one that failed, and IN stays in the test - it is real coverage of a huge range - bounded by the @timeout hang detector like every other non-claim here. The sibling bound in LongRangeListTest is unaffected and passed CI in 0.012 s: that one calls LongRangeList.contains() directly, which IS the O(1) path. Worth filing separately: Cypher IN over a lazy list could take the O(1) contains() when the list holds no null, which is the common case and the only one where the walk is pure cost. Out of scope here - it is an evaluation change with its own semantics to pin. * review: count the claims once per routing table, not twice Sixth review round on #6307, non-blocking. selectUnambiguousRouting builds the claim counts internally and warnAmbiguousRouting rebuilt the same map from the same view - occasional before, but the warning now runs on every call, so it was a duplicate HashMap per ROUTE request and per refusal. Counted once in routingTableFor and handed to both, which is what unambiguousPeerAddress already does with its twin. selectUnambiguousRouting keeps its four-argument form as a delegating overload, so Issue6183AmbiguousRoutingTest still drives it the way it did.
Fixes #6260.
The problem
Two engine tests went red in a full-suite run while the code behaved correctly:
AsyncShutdownDrainTest.closeDoesNotHangOnAWedgedAsyncWorkerASYNC_CLOSE_TIMEOUTplus a 2 s joinIssue6199DrainWakeupTest.theResidualDrainKeepsItsHardDeadlineBoth pass in isolation. Late in a 12,000-test single-JVM run a stop-the-world pause of tens of seconds is not exotic, and any assertion whose headroom is smaller than that becomes a coin flip on the JVM's mood rather than a statement about the code.
Why the issue's own proposal is not enough, and what this does instead
The issue proposes reclassifying each bound and widening the ones that are only tripwires. That is right as far as it goes, but it cannot cover the set.
grepturns up 40 elapsed-time assertions in the engine suite, and a large family of them reads:That 1000 cannot be widened. It is discriminating one shared 200 ms deadline from ten independent per-row ones, so the moment it goes past 2000 the assertion stops asserting anything. Widening it is not a repair, it is a deletion. And the same stall that broke the two named tests breaks these too - it is simply luckier so far.
So instead of adjusting the numbers, this fixes the measurement. A daemon sampler parks for 10 ms at a time and accumulates, into a monotonic counter, however much longer than that each park actually took. The difference of two readings is the JVM-wide stall observed inside that interval; subtracting it from a wall-clock measurement over the same interval leaves the time the JVM was actually running. Every bound stays exactly as tight as it was, and none of them can be tripped by a pause.
What is deliberately not discounted: time the measured thread spends sleeping, parked or blocked on I/O. The sampler keeps ticking then, so a test that waits a second is still charged a second - only a stall that also stops the sampler is taken out. Otherwise every latch wait in the suite would silently become unbounded. The sampler also runs at the default thread priority on purpose: it is a proxy for the measured thread, so it has to lose the same races for a core. Raising it would let it tick straight through the CPU starvation the measured thread is suffering, and starvation is the half of the problem a GC-pause-only view cannot see.
The two assertions, and why there are two
They differ only in the failure message, and that is the point - the message is what stops the next person from "fixing" a red run by loosening the number:
assertGaveUpWithin(bound, whatItSeparates)- the bound is a tripwire between a bounded operation and an unbounded one. Generous is free here; a wider bound cannot turn a passing run red. Failure says so explicitly.assertStayedUnder(bound, claim)- the bound IS the assertion, standing in for a complexity claim with no other practical expression (a regex that must not backtrack exponentially, a deadline shared across rows rather than charged per row). Failure says loosening it deletes the test.A short wait expected to TIME OUT needs neither, and neither does a lower bound: a stall only makes those more true.
Scope
40 assertions across 26 test classes converted. Per the taxonomy above:
isGreaterThanOrEqualTosites inSQLScriptAdditionalCoverageTest,CodeUtilsTest,PaginatedSparseVectorEngineBackpressureTest,Issue5693TxRetryDelayScopeTest.isBetweensites (FlushRobustnessTest,Issue6125SnapshotBarrierAndCapTest) now read raw wall clock for the floor (which proves the wait really blocked) and the discounted time for the ceiling.Issue5587TxRetryExponentialBackoffTestcompares the sum of early retry gaps against the sum of late ones. A pause landing in either half skews the ratio, so it now samples the stall counter alongside each timestamp and differences both.@Timeoutraised - three annotations at 30 s on tests whose own budget is already 16 s or more. JUnit's timeout is plain wall clock and cannot be discounted, so it has to be sized as a hang detector, not as a latency bound.CLAUDE.mdgains the rule so new tests do not reintroduce the pattern.Verification
StallAwareStopwatchTestreproduces the reported failure directly: with a 24 s stall injected into the window, a measurement that failed a 15 s bound pre-fix now passes, while an equally slow operation with no stall to hide behind still fails - the fix must not have deleted the tests it was meant to save. The stall is injected rather than provoked because provoking a multi-second stop-the-world pause on demand is exactly as unreliable as the flake being fixed.enginesuite: 12,093 tests, 0 failures, 0 errors (mvn -o -pl engine -am test -DexcludedGroups=benchmark,vector,slow), plus theslowandvectorlanes for the touched classes.Files
New (engine test sources):
engine/src/test/java/com/arcadedb/utility/JvmStallMonitor.javaengine/src/test/java/com/arcadedb/utility/StallAwareStopwatch.javaengine/src/test/java/com/arcadedb/utility/StallAwareStopwatchTest.javaThe helper lives in the
enginetest-jar, so theserverand protocol modules can adopt it for their own timing assertions in a follow-up.🤖 Generated with Claude Code
https://claude.ai/code/session_016yjKJXMNMQeLPKdCno7cFX