Repository navigation
test(smoke): wait out a settling edge before calling a chunk broken - #474
Conversation
The chunk crawl read a Workers version uploaded seconds earlier and reported four chunks as broken on 500. All four served 200 from the same pinned address afterwards, and Smoke passed on the next head with no deploy change — so the deploy held every chunk the whole time. The lane's `retry: 2` cannot absorb that window: each retry re-crawls from scratch, so the three attempts raced the same window instead of waiting it out, and the broken set only shrank, 4 -> 3 -> 2. The crawl now re-checks a 5xx itself, six rounds three seconds apart. This costs the defect the spec exists to catch nothing. A chunk the deploy does not hold answers the SPA shell with 200 `text/html`, never a 5xx, so the content-type check still reports it with no waiting. Watched all three behaviours against a stand-in deploy: a chunk that 500s three times then heals passes in 9.3s, one served as the shell fails in 0.3s, and one that 500s forever fails in 18.3s naming it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYmyVdnfkJdPkJxsXM
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Right-sized: two files, no product code, and the branch does what the body says. The new loop is correct — it terminates, a 200 text/html shell still fails instantly, and a chunk that heals mid-settle is still crawled for its own children.
Two things do not line up. The settle budget is 18s, while this PR's own measurement of the window it exists to absorb is ~25s, so a repeat of #466 still needs the retry the change says cannot help. And the docs/testing.md section restates the code comment beside it, the two new constants' values included.
Since the diff grows this file, one older layer too: crawlDeploy's memo has a single caller and nothing ever reads its cached value.
Findings
should-fix— settle budget is below the window it was measured against ·tests/smoke/embed.smoke.test.ts:87should-fix—crawlDeploy's memo pays no rent ·tests/smoke/embed.smoke.test.ts:53should-fix— the docs section is a second home for the code comment ·docs/testing.md:215
What was checked
- Read whole on the branch: the spec,
vitest.smoke.config.ts(testTimeout: 30_000,retry: 2),_helpers/preview.ts, and the new docs section in context. new-pieces.mjs:NONE, so no streamliner ran. Ladder walked by hand:node:timers/promisesis the platform API and adds no dependency;SETTLE_ROUNDS,SETTLE_WAIT_MSandreadeach earn their place.- Held on the whole-file pass:
fetchEmbed's memo (two consumers), the backtick inRELATIVE_JS, GET-not-HEAD, and90_000, which covers 18s of waiting plus the crawl. - Grepped the suite before proposing the prose figures go — nothing pins 9.3/0.3/18.3.
- No contract surface touched:
docs/embedding.md,public/_headers,robots.txtand the generated types are all untouched, so there is no consumer side to follow. No question threads.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Six rounds of three seconds waited 18s, while the only window this exists to absorb — #466's chunks at 500 — ran about 25 seconds. A repeat of #466 would still have failed its first attempt and gone green only through the `retry: 2` the budget exists to replace. Ten rounds clear that window on one attempt, inside the spec's own 90s timeout. The JSDoc now states the coupling, so a later trim of either constant has to read it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXqLs7mohV6h2RXY9K
One spec awaited `crawlDeploy`, and the only outcome the memo kept was a clean crawl — which nothing asked for a second time. `retry: 2` re-runs the body only after a failure, and a failure cleared the memo, so attempt two always re-crawled. `fetchEmbed`'s memo stays: that one has two consumers. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXqLs7mohV6h2RXY9K
The section held the 25-second #466 measurement, the retry reasoning, the 200 `text/html` invariant and both constants' values a second time, beside a stand-in test run nothing asserts. Named `SETTLE_ROUNDS` instead and kept what the code cannot carry: the lane-level intent, the warning, the #466 breadcrumb, and why the retry lost. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXqLs7mohV6h2RXY9K
|
All three critic findings adopted, none rebutted.
Body refreshed: raising the budget made the "18 seconds is above the one window measured" note and two rows of the timing table false. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
embed.smoke.test.ts's chunk crawl now re-checks a 5xx itself, forSETTLE_ROUNDSrounds, instead of calling the chunk broken on the first one. The budget clears feat(widget): open every embed inline; expand the map over the page #466's window on one attempt.crawlDeploy's memo goes: one spec awaited it, and nothing ever read its cached value.docs/testing.mdgains the lane-level intent and the one rule the change must not be widened past.Extracted from #466's red
Smokecheck, which was not a defect in that branch. No product code here.What happened
On #466's head
69bede0the crawl reported four chunks broken on 500:The deploy held all four the whole time:
text/javascriptfrom that same pinned address now, with no redeploy.Smokepassed on the next head,72ed9ae, which changes no asset pipeline.retry: 2fired and the broken set only shrank across the three attempts — 4 → 3 → 2 — which is a version still coming up, not a graph with holes in it.The retries cannot buy that time, and that is the actual defect: each one re-crawls from scratch, so all three raced the same ~25-second window rather than waiting it out.
Why this costs the spec nothing
The failure this spec exists to catch is a loader published without the graph behind it. A chunk the deploy does not hold answers the SPA shell with 200
text/html(assets.not_found_handling), never a 5xx — so the content-type check still reports it immediately, with no waiting at all. Only a 5xx buys patience.Test results
Watched every behaviour against a stand-in deploy, so the new branch is exercised in both directions:
text/html(the shell).claude/skills/pr-prep/check.sh— lint, typecheck, 2372 unit testsa24d6af4-sahajatlas-web, the very deploy whose read went red — run on57737a1, before the budget rose. A clean deploy waits for nothing either way.Notes for reviewer
SETTLE_ROUNDS/SETTLE_WAIT_MSare a budget, not a tuning knob. Their product must stay above feat(widget): open every embed inline; expand the map over the page #466's ~25-second window, which is the coupling the JSDoc now states. A genuinely broken deploy pays the budget once per attempt; a missing chunk pays none of it.markdownandtests/**here, so neither the browser lane nor the size budget can be affected.