Repository navigation
improve(test): speed up config save browser tests - #192116
Conversation
Advance full secret idle windows and applied-revision polling with the page clock while preserving RPC, payload, and geometry assertions. Wait for the real resize transition before recording the reference geometry. Co-authored-by: steipete <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR advances browser clocks through config-save waits and waits for the resize transition before comparing geometry. Example: The browser test types partial-token into Api Token.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a focused test-speed improvement that preserves existing assertions; no actionable defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe browser tests drive Settings forms against a mock Gateway, exercising production UI timers and checking RPC payloads, save status, reload values, and geometry. flowchart LR
A[Browser test] --> B[Playwright page clock]
B --> C[Settings UI timers]
C --> D[Mock Gateway]
D --> C
C --> E[Status and geometry assertions]
Technical reviewBest possible solution: Keep the existing fixtures and production owners while advancing complete timer windows and preserving every behavioral assertion. Do we have a high-confidence way to reproduce the issue? This is test optimization rather than a product bug; source confirms the original real waits, and the PR supplies paired benchmark results that were not rerun during this read-only review. Is this the best way to solve the issue? The change uses the existing page-clock capability, retains complete idle windows and production polling, and introduces no parallel owner or test-only production seam. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5a4da85b672b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +12, Other +2. Total +14 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 3, 2026, 12:19 PM ET / 17:19 UTC. |
|
Merged via squash.
|
Advance full secret idle windows and applied-revision polling with the page clock while preserving RPC, payload, and geometry assertions. Wait for the real resize transition before recording the reference geometry. Co-authored-by: steipete <[email protected]>
Related: #191958 (clock and owner-proof precedent)
What Problem This Solves
Config-save browser tests spend real time waiting through secret-field idle windows and saved-revision polling.
User Impact
No user-visible change. The same 14 cases pass faster: summed file medians fall from 54.607s to 46.819s, saving 7.788s (14.26%) on the measured Testbox.
Why This Change Was Made
Install the existing Playwright page clock before navigation. Advance every original 1.5s/1.2s secret idle window in full, retaining the zero-write assertions, then resume normal time for neighbor autosave. Advance time between Apply-status reads so the real config polling owner, mock WebSocket responses, and promise settlement still determine the result.
Typed, cleared, template/include, Cancel, exact Save payloads, RPC acknowledgments, Saved-before-Apply, external-edit/reload values, and all geometry assertions remain. No production change, direct refresh, fabricated state, timeout change, or injection seam.
The resize comparison now waits for the shell's actual CSS transition to finish before taking its reference box. The earlier candidate exposed the existing same-frame stabilization poll accepting a still-moving layout; its failed geometry run is excluded from the final timing samples. The coordinate-stability poll and both exact box assertions remain.
The simplification pass kept this within the two existing test fixtures. Test delta +16/-4, net +12 lines; the requested
config/test-lines-allocations/ui-config-clock.txtrecords the 12-line justification. Including that two-line record, the complete delta is net +14 lines. Production delta: zero.Evidence
Three baseline and three final candidate runs used the same Blacksmith 16-class Testbox
tbx_01m6h3yv7sfjwg54xn4r0bnef4, with frozen-lockfile installation: Testbox run 41674898066. All six measured runs passed all 14 cases. The file numbers below are native Vitest file durations, including hooks, rather than command wall time or a CI critical-path claim. Baseline source:868609a3f6cb9d736d89b577b57ebedb899d5d4f. Candidate commit:33800a46f58b063383e016526341c328b61775b0.ui/src/e2e/config-secret-field-save.e2e.test.tsconfig-safe-write.e2e.test.tsThree samples and relevant case medians
config-secret-field-save.e2e.test.tsconfig-safe-write.e2e.test.tsCommand, repeated three times per version:
All paired mutation controls ran on the same Testbox. Mutations changed production behavior temporarily and were restored between executions. Killed means the existing test failed; survived means the selected existing tests passed.
config.patchafter 750ms, inside the claimed idle windowconfig.applysubmission{}config.applysubmission{}original-apiinstead ofexternal-apiThe two cross-file survivors also survive on unchanged baseline tests. The other file owns the missing behavior and kills the same mutant in both versions:
config-secret-field-save.e2e.test.ts:expect(await gateway.getRequests("config.patch")).toHaveLength(0)fails with one early request. The cleared-secret case also fails its zero-write assertion. Safe-write has no secret field.config-safe-write.e2e.test.ts: it awaitsgateway.waitForRequest("config.apply")and assertsexpect(applyParams.raw).toBe(rawDraft). Disabling Apply fails that RPC wait on both versions. The secret-field file does not apply config.No baseline kill became a candidate survival. All 12 matrix executions completed. Five production input hashes were checked against the local frozen source; all 13 product restorations and both final test-file restorations were verified by SHA-256. No mutant or probe is committed.
Scoped format, lint, and two-file typecheck passed on Testbox. Final isolated Codex autoreview of the complete local candidate against the base above: P0–P2, scoped-clean, no actionable findings. Its unchanged context omitted the secret-owner file because the review helper rejects that filename; the changed tests, mock Gateway, and timer/config owners were included. Runtime and mutation proof were collected separately.
All browser executions, installs, builds, and checks ran on Testbox. No browser/container run, broad suite, dependency install, or broad lint/typecheck ran on the production Team host. The owned Testbox was stopped after proof. PR CI supplies broad validation. No merge is requested.