Commit 9966026
authored
fix(smoke-test): harden release test against Cloudflare propagation race (#1141)
## Summary
- The production release smoke test has been flaking on `main` — two
consecutive Release workflow failures today
([24390750381](https://github.com/redwoodjs/sdk/actions/runs/24390750381),
[24389368095](https://github.com/redwoodjs/sdk/actions/runs/24389368095))
— with the same pair of errors:
- `Smoke test status element not found in the page`
- `The __rw API or upgradeToRealtime method is not available`
- Root cause: a freshly deployed `*.workers.dev` subdomain can return
HTTP 200 with Cloudflare's *"There is nothing here yet"* placeholder for
a window after `wrangler deploy` completes, before the worker code is
globally propagated. The existing `checkServerUp` treats any 2xx as
"up", so Puppeteer loads the placeholder and both errors follow —
neither the app HTML (no `[data-testid="health-status"]`) nor the client
bootstrap (no `window.__rw`) are present. The failing local
reproduction's screenshot confirmed it: Cloudflare's "There is nothing
here yet. If you expect something to be here, it may take some time.
Please check back again later." page.
## Changes
1. **`release.mts`** — after the reachability check, poll the deployed
URL until the response body contains `__RWSDK_CONTEXT` (emitted on every
rwsdk-rendered page). The placeholder lacks this marker, so the poll
only clears once the real worker response is being served. 60s timeout,
2s interval.
2. **`codeUpdates.mts`** — rename the smoke test's `Document.tsx`
references to `document.tsx`. The starter was renamed in `20081aad`
(2026-01-26) but the smoke test wasn't updated; on case-sensitive Linux
CI this was silently swallowed and surfaced as `URL Styles / Client
Module Styles: DID NOT RUN` warnings. Picked up from the existing fix on
branch `pp-implement-1131-synced-state-reconnect`.
## Test plan
- [x] Local smoke test reproduced the original failure (`Smoke test
status element not found in the page`).
- [x] Same smoke test with this fix passes end-to-end, dev + production
(`Smoke tests passed for 'starter' with 'pnpm'`).
- [x] SDK build passes (`pnpm --filter rwsdk build`).
- [ ] Release workflow rerun on `main` after merge to confirm CI passes
consistently.
Note: in local testing, propagation cleared on the first poll attempt
(`Deployment content ready ... (attempt 1)`), so the retry path itself
wasn't exercised end-to-end. The logic is small (fetch → substring check
→ sleep → retry) and low-risk, but we'll want to watch the next few
release runs for any edge cases.
🤖 Generated with [Claude Code](https://claude.com/claude-code)3 files changed
Lines changed: 68 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
398 | 402 | | |
399 | 403 | | |
400 | 404 | | |
401 | 405 | | |
402 | | - | |
| 406 | + | |
| 407 | + | |
403 | 408 | | |
404 | 409 | | |
405 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
33 | 82 | | |
34 | 83 | | |
35 | 84 | | |
| |||
63 | 112 | | |
64 | 113 | | |
65 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
66 | 122 | | |
67 | 123 | | |
68 | 124 | | |
| |||
0 commit comments