Skip to content

fix(ci): Smoke reds on a transient 5xx from the preview it just published #473

Backlog

Description

@sydevs-bot

Summary

The Smoke check reads a Workers preview its own job published seconds earlier. On 2026-11-24 three CI runs inside ten minutes read 500 from assets that same preview serves correctly, reddening a required check on healthy commits.

#474 settled the measurement and fixed one read of the lane. It measured the window at about 25 seconds on #466, and gave the chunk crawl a bounded 5xx re-read (SETTLE_ROUNDS = 10 × SETTLE_WAIT_MS = 3_000) instead of leaning on the lane's immediate retry: 2. What remains is every other read of the preview, which is still one bare fetch — including /loader.js, the read that reddened run #470.

Approach

fetchPreview is one bare fetch (tests/smoke/_helpers/preview.ts:22), and 15 of the lane's 16 call sites read through it unchanged. Only the crawl's own read helper waits.

1. Move the budget into the helper, and export a settling read beside the raw one.

2. Keep the crawl's batched loop; have it read through the helper's budget.

crawlFromLoader re-reads every unsettled path in one round, so N chunks share one wait instead of paying it serially — four chunks at the budget would be 120s read one at a time against 30s batched. That loop stays in embed.smoke.test.ts; what it stops owning is the two constants.

3. Point the single-path reads at fetchPreviewSettled. Each asserts a 200 and nothing asserts a 5xx anywhere in the lane, so none of them is weakened:

4. Raise testTimeout once, in vitest.smoke.config.ts:11. It is 30s, which the 30s budget alone would exhaust before a spec could name the status — criterion 2. #474 solved that for the crawl with a 90s per-spec timeout; twelve more per-spec timeouts would be twelve places to keep above one budget. Raising the lane's own timeout costs no failure speed, because a non-5xx answer still fails on the first read with no waiting at all. Its cost is that a genuinely hung request holds a worker for the new timeout rather than 30s.

5. Leave retry: 2 alone (vitest.smoke.config.ts:16). #474's finding is that retry cannot buy the settling time, not that it buys nothing: it stays the outer net for a failure the settle loop does not model.

⚠ Do not widen the wait to a non-5xx status. A path the deploy does not hold answers the SPA shell with 200 text/html (assets.not_found_handling), never a 5xx, so every spec above still reports a missing or wrong file on its first read. That instant half is what the lane exists for, and docs/testing.md's second smoke invariant is why a status check alone would not see it.

Acceptance criteria

  • A 5xx the preview stops returning inside the budget no longer fails any spec in the smoke lane, not only the chunk crawl.
  • A path the preview cannot serve at all still fails Smoke on its first read, naming the path and the status, with no waiting.
  • A path that 5xx's past the budget fails Smoke naming the path and the status, rather than timing out.
  • The budget has one home. No spec file declares its own SETTLE_ROUNDS or SETTLE_WAIT_MS.
  • docs/testing.md's section on this covers the lane, not only the crawl, and still carries the ⚠ above. The measured window and the settled numbers stay in the one code comment beside them — test(smoke): wait out a settling edge before calling a chunk broken #474's critic rejected a second home for them, so do not copy them into the doc.

Verification checklist

  • PREVIEW_URL=<a preview published under a minute ago> pnpm test:smoke passes.
  • Watched against a stand-in deploy, as test(smoke): wait out a settling edge before calling a chunk broken #474 did, each in both directions: a path that 500s then heals passes; one that answers 200 text/html fails immediately; one that 500s for ever fails naming the path and the status, inside the lane's timeout.
  • PREVIEW_URL=https://design.sahajatlas.com pnpm test:smoke still fails ten specs, so the lane is not vacuously green (docs/testing.md's own non-vacuity read).
  • pnpm lint && pnpm typecheck.

Notes

This extends #474 and must land after it — it moves the two constants that PR introduces. #474 is open, green and reviewed, with no human verdict yet. No Blocked by: line: that marker takes an issue, and #474 closes none.

What was observed, all on 2026-11-24:

run job read result
#470 45454784922 138661361480 18:00Z /loader.js 500 on all three attempts
#466 45454048767 138658567468 17:56Z /assets/InlineEmbedView-*.js, EventFacts-*.js, CalendarView-*.js 500, and the set differed between its own retries (three, then two)
#471 45455033534 — 18:02Z the whole crawl passed

Activity

  1. added theissue type on Nov 24, 2026
  2. added
    proposal
    on Nov 24, 2026
  3. Ardnived commented on Nov 25, 2026

    @Ardnived
    Contributor

    @sydevs-bot revise - check if any of the recent PRs already address this

  4. added
    bot:working
    and removed
    proposal
    on Nov 25, 2026
  5. sydevs-dispatcher commented on Nov 25, 2026

    @sydevs-dispatcher
    Contributor

    🤖 no session running

    recent dispatches
    • 20:24Z revise · attempt 1 · session · done
    • 20:24Z revise · attempt 1 · session

    Written by the sydevs dispatcher. Sessions never edit this comment.

  6. sydevs-bot commented on Nov 25, 2026

    @sydevs-bot
    ContributorAuthor

    One PR addresses part of it: #474, still open. Nothing else in the lane has moved since.

    #474 measured the window at ~25s on #466 and gave the chunk crawl a bounded 5xx re-read. It leaves every other read of the preview a bare fetch — including /loader.js (embed.smoke.test.ts:163), which is the read that reddened run #470, and the hashed /assets/* read at cache-headers.smoke.test.ts:103. 15 of the lane's 16 call sites still wait for nothing.

    So the ticket is not covered, and I rewrote it as the remainder: move #474's budget into _helpers/preview.ts, add a settling read beside the raw fetchPreview, point the single-path specs at it, and raise testTimeout once so a spec can still name the status instead of timing out. It must land after #474, which it builds on.

    Two body claims were stale and are gone: that nothing was changed on 2026-11-24, and that the window was unmeasured.

    @sydevs-bot implement starts the work.

    🤖 Written by the sydevs autonomous loop — see what this is


    Generated by Claude Code

  7. removed
    bot:working
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions