You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1f46ea1
Browse filesBrowse the repository at this point in the historyBrowse files
test(driver-turso): await the "remote was reached" latch instead of sampling a request counter (#17121) (#17282)
* test(driver-turso): await the "remote was reached" latch instead of sampling a request counter
`turso-driver-timeout.test.ts` asserted "the remote really was reached" by
reading a request COUNTER at the instant the 100 ms window closed, twice. The
sample instant is chosen by the very timer under test, and libuv runs the
TIMERS phase before the POLL phase: any stall that spans the window delivers
the abort -- and every assertion that follows it -- before the server's
already-arrived bytes are parsed into a `request` event. The counter then reads
0 for a request that is demonstrably on the wire, and the file fails as
`expected 0 to be greater than 0` from a merge-queue runner, presenting as a
behaviour regression when it is a load artefact.
Measured on the fixture, freezing the loop 300 ms from the moment undici
publishes `undici:client:sendHeaders`: 6/6 runs read the counter as 0 while
`undici:client:sendHeaders` had fired, the server had accepted the connection,
and the request handler dispatched ~2 ms AFTER the assertion would have run.
The driver answered TIMEOUT / 504 in every one of them, so the competing
hypothesis -- a 504 for a request that never left the process -- is excluded
under this reproduction.
The fixture now exposes a latching `firstRequest` promise the tests AWAIT, and
the positive case proves reachability with an UNBOUNDED driver before the timed
one runs. A window may legitimately close before its own request is issued, so
"this timed request reached the remote" is not a promise the timed operation
can be made to keep; "this fixture is a remote the transport reaches" is, off
the timed path, and that is the anti-vacuity guard the case needs. Every
product assertion is unchanged: the envelope (TIMEOUT / 504), the message, the
elapsed bound, and the three negative controls all still pin what they pinned.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTBcV7zZHmokdyQgXjbyEU
* test(driver-turso): name the bound in the latch assertion's failure message
A red from a sampled counter reads `expected 0 to be greater than 0`, which
names no duration -- and merge-queue triage classifies a red by asking exactly
that, so the flake this file produced was read as a behaviour regression. Both
latch assertions now carry a message naming the bound they missed, so the red
says in words that a duration went unmet.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XTBcV7zZHmokdyQgXjbyEU
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments