Repository navigation
test(ui): stop cloud-workers save assertions racing form state - #125456
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 17, 2026, 9:04 PM ET / August 18, 2026, 01:04 UTC. ClawSweeper reviewWhat this changesThe PR adds pre-Save polling assertions to the Cloud Workers Control UI end-to-end test after form edits. Merge readiness⛔ Blocked by patch quality or review findings - 5 items remain Keep open: the revised polls still observe only control values, not the draft captured by Save, so they do not prove or repair the claimed race. Priority: P3 Review scores
Verification
How this fits togetherCloud Workers settings flow from browser controls into a page-local draft, then Save serializes that draft into a Gateway configuration patch. The affected E2E test validates the resulting patch through a mocked Gateway. flowchart LR
A[Browser form controls] --> B[Cloud Workers draft]
B --> C[Save action]
C --> D[Configuration patch]
D --> E[Mock Gateway assertion]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceTests +17. Total +17 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Replace the polls only with a regression that demonstrably fails before the repair at the draft-to-Save/config.patch boundary; otherwise remove the redundant waits. Do we have a high-confidence way to reproduce the issue? No: the PR reports intermittent CI behavior but provides no failing pre-fix draft-to-Save reproduction; source shows the proposed polls do not test that boundary. Is this the best way to solve the issue? No: polling form-control state is not the best fix because Save uses the page draft; the existing outgoing-patch assertion is the relevant boundary to reproduce and protect. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b1d5e78771f9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
355b991 to
d9a38c7
Compare
|
Land-ready verification for exact head
Latest ClawSweeper item disposition:
|
|
Merged via squash.
|
What Problem This Solves
ui/src/e2e/cloud-workers-settings.e2e.test.ts("adds and edits profiles while distinguishing advertisedstate") fails intermittently on CI — it blocked PR #125105 with
expected { Object (cloudWorkers) } to match object { Object (cloudWorkers) }, while passing onmain, passing isolated on that branch (3/3), andpassing when run directly after an unrelated e2e in the same invocation (12/12).
The cause is the gap between the last edit and the Save click. The test fills several Web Awesome form
controls and toggles a
wa-switch, then clicks Save immediately:Nothing there proves those controls have committed their values to component state, so the patch can be
assembled from a value the form has not absorbed yet. The test synchronized on when a request arrived
rather than on the UI reaching an asserted state — a timing dependency in the shape of a wait.
Why This Change Was Made
A settings test that fails under load teaches people to hit rerun, which is how a real serialization
regression would slip past. The fix makes the precondition explicit: before each Save, every edited control
is asserted to hold its new value — inputs by
inputValue(), the Desktop switch byaria-checked="true"—so the click cannot outrun the form. All three save paths in the file get the same treatment.
Deliberately unchanged: the
toMatchObjectexpectations. Trimming fields from them, polling the assertionuntil it matched, sleeping, or raising timeouts would each have made the test stop failing without making it
correct — and this case exists to catch exactly the class of bug where an edited field never reaches the
patch.
User Impact
None. Test-only; no production file is touched.
Evidence
Ten consecutive runs, since one green run says nothing about a race:
pnpm check:changedgreen; Codex autoreview clean.reviewMetrics — production vs test LOC: production
0, tests+17 / −0— pure addition, so no existingassertion was relaxed to achieve it.
No
CHANGELOG.mdedit — release-only per repo policy; test-only change.