Repository navigation
fix(analytics): a nested invocation's db_ms no longer exceeds its parent's - #497
Merged
Merged
Conversation
Owner
Author
|
Codex review (GPT 6.1 Sol, read-only), It traced the new order: ancestors start first and the child releases first, so Both new tests failed with the old ordering restored (parent/child |
…ent's The meter's start read this collector's clock before starting the parent, so a stall between those readings gave the parent a shorter interval than its child. Start ancestors first; release already stops this collector before its parent, so each ancestor's interval now contains its child's. Closes #491 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
allisonmahmood
force-pushed
the
t3code/12e48e61
branch
from
October 3, 2026 19:26
ed814fe to
cef77a9
Compare
3 of 4 tasks
allisonmahmood
added a commit
that referenced
this pull request
Oct 3, 2026
…wice (#496) # What changed The nested CSS watch test in `pageImports.test.ts` flaked on CI (`test (22)` on #485). It read one watcher result per file write. A plain write truncates and then writes, which can trigger two rebuilds, so a stale duplicate refusal could stand in for the fixed build. The test now saves by renaming a complete file into place, and its `next()` skips a result identical to the one it last returned. These are the mitigations the dev server's watch test already uses (`save` and `inspectedChanges` in `devServerWatch.test.ts`). Assertions stay outside the wait, so a new error or unexpected CSS still fails. No production code changes; triage found no production defect. Closes #487 ## How it was verified - [x] `pnpm test` passes locally - [x] Added or updated tests covering this change - Temporary checks (not shipped): pushing a duplicate refusal into the queue before and after the fix write fails the old test, and the new test reaches the blue build. The new test still fails on a differing refusal after the fix, or on a fix that writes green instead of blue. - `isDeepStrictEqual` treats two `LocalError` refusals with the same code and message as equal, and different ones as unequal, on Node 22.22.0 and 24.20.0. - Looped 50 times each on Node 22.22.0 and 24.20.0, run concurrently: 100/100 passed. - `pnpm verify`: format, lint, typecheck, test (1625/1625), postgres-concurrency, cli-smoke, tier2-smoke and browser pass. - After rebasing onto `b320800` (#497), which adds an unrelated `it.each` build test to the same file: looped 25 times each on Node 22.22.0 and 24.20.0, 50/50 passed; format, lint and test typecheck pass. ## Release impact - [ ] **Breaking** - [x] **Not breaking**: test only. ## Review - GPT 6.1 Sol (codex): no findings. - `/code-review` standards and spec passes: no hard findings. The file's node-builtin waiver reason now covers the deep comparison. Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
A nested mutation's
db_mscould come out larger than its parent action's, which breaks the documented contract that a child's connection time counts toward the parent. It showed up as a CI failure in the dev-execution test (parent 2, child 3). In production it skews invocation rows and the quiet-query rollups by up to one GC pause per nesting level.The cause was the order of clock reads in
DatabaseMeter. When a reservation started, the child read the clock before starting its parent, so a stall between those two reads gave the parent a shorter interval than the child.Collector.start()now starts the parent before taking its own reading. Release already stops the child before releasing the parent, so every ancestor's interval now contains its descendant's, at any depth and wherever a stall falls. TheCollectorinterface,ConnectionTimingand the dev-execution assertion are unchanged, and no tolerance was added.New tests in
packages/analyticsrun two- and three-level chains over a scripted clock that stalls between the reads insidestart(). Both fail on the old ordering.Closes #491
Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex.