Skip to content

test(relay): cover the remaining upstream-FETCH failure and shape edges - #79

Merged
floatdrop merged 1 commit into
draft-19from
test/fetch-upstream-edges
Aug 13, 2026
Merged

test(relay): cover the remaining upstream-FETCH failure and shape edges#79
floatdrop merged 1 commit into
draft-19from
test/fetch-upstream-edges

Conversation

@floatdrop

Copy link
Copy Markdown
Owner

Finishes the §9.4 stitching path started in #78 — items 1–3 of the remaining list. Generalises that PR's harness so one topology drives every way an upstream can misbehave, and every shape the response must carry across the hop.

What's covered

Two distinct upstream timeouts, not one. Silence before the FETCH_OK expires Session.Fetch itself; silence after it leaves the relay waiting on a response body stream that never arrives — from an upstream that looked entirely healthy a moment earlier. Separate branches; only one was reachable through the old harness. Both must degrade to unknown, never to an authoritative gap.

Descending + capped FETCH_OK falls back to whole-range unknown. Ascending can append a marker for just the uncovered remainder; descending cannot, because that remainder precedes every object in stream order and a leading marker cannot be followed by a same-group object with a lower ID.

The §11.4.4.1 Datagram bit survives the hop. It records the Forwarding Preference the object was published with, which a FETCH response must report faithfully even though the response always travels on a stream.

Two process notes worth reading

Coverage profiles, not assumptions. I checked each branch actually executes before trusting the test. That is how the acked-but-silent timeout was found at all: the first timeout test passed while leaving its intended branch unreached — it was exercising an earlier timeout on a different line.

Presence is not position. The descending test originally asserted only that an unknown marker exists, and passed with the branch deleted — because the ascending path emits a marker too. What separates the encodings is where it is anchored, so it now pins the marker's Location: group 0 for the whole-range fallback, not the top of the range. Same category of mistake as the alias-idempotency slip in #77; mutation caught both.

The Datagram test likewise asserts the bit is not set on the cached subgroup objects, so it cannot pass by the bit being sprayed onto everything.

All four behaviours verified red by mutation.

pkg/relay 85.6% → 86.0%; whole-suite holds at 90.1%.

Remaining

Only item 4 from the list: a shared Conn conformance suite for wtconn/quicconn, the documented gap the hermetic suite genuinely does not drive. Different shape of work — a real-transport harness rather than relay topology.

🤖 Generated with Claude Code

Finishes the §9.4 stitching path started in #78, generalising its harness so
one topology can drive every way an upstream can misbehave and every shape the
response has to carry across the hop.

Two distinct upstream timeouts, not one. Silence BEFORE the FETCH_OK expires
Session.Fetch itself; silence AFTER it leaves the relay waiting on a response
body stream that never arrives, having looked entirely healthy a moment
earlier. They are separate branches and only the second was even reachable
through the old harness. Both must degrade to unknown rather than to an
authoritative gap. Both use the subscriber's own FILL_TIMEOUT (§10.2.6), which
the relay adopts for the upstream leg — otherwise each case would sit out
defaultUpstreamFetchTimeout for 5s.

Descending order with a capped upstream FETCH_OK falls back to marking the
WHOLE sub-range unknown. Ascending can append one marker for just the
uncovered remainder; descending cannot, because that remainder precedes every
object in stream order and a leading marker cannot be followed by a same-group
object with a lower ID. Asserting the marker merely EXISTS does not test this
— the ascending path emits one too. What separates them is where it is
anchored, so the test pins the marker's Location: group 0 (the sub-range
start) for the whole-range fallback, not the top of the range. The first
version of this test checked presence only and passed with the branch deleted.

The §11.4.4.1 Datagram bit survives the hop. It records the Forwarding
Preference the object was PUBLISHED with, and a FETCH response reports that
faithfully even though the response itself always travels on a stream.
Dropping it would rewrite history for exactly the objects that came from
another relay, so a subscriber comparing a stitched range against a live one
would see the same object described two ways. The test also asserts the bit is
NOT set on the cached subgroup objects, so it cannot pass by being sprayed
everywhere.

All four branches confirmed to execute against a coverage profile before being
trusted — the acked-but-silent case was found precisely because the first
timeout test passed while leaving its intended branch unreached — and each
verified red by mutation.

pkg/relay 85.6% -> 86.0%; whole-suite holds at 90.1%.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@floatdrop
floatdrop merged commit f09b6df into draft-19 Aug 13, 2026
11 checks passed
@floatdrop
floatdrop deleted the test/fetch-upstream-edges branch August 20, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant