Repository navigation
fix(test): prevent premature startup authentication test failures - #155006
Conversation
|
🦞👀 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 changes before merge. Reviewed September 21, 2026, 1:05 PM ET / 17:05 UTC (Revision 3). ClawSweeper reviewWhat this changesThe startup WebSocket tests await their existing response promise and committed setup-completion event before checking persistence or closing successful bootstrap connections. Merge readiness⛔ Needs changes before merge - 1 item remains The prior confirmation-race finding is resolved, and no new actionable defect was found. Current main still contains the original polling helper, so this focused repair remains useful. Priority: P2 Review scores
Verification
How this fits togetherGateway startup tests simulate node connections while startup admission is restricted. They verify authentication responses, durable pairing completion, and release of tracked handshake work. flowchart TD
A[Simulated node connection] --> B[Startup admission and authentication]
B --> C[Connection response]
C --> D[Durable setup confirmation]
D --> E[Setup completion event]
E --> F[Persistence assertions and socket cleanup]
B --> G[Admission lifetime assertions]
Before merge
Agent review detailsSecurityNone. PR surfaceTests -4. Total -4 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep response delivery, durable setup completion, and admission release as separate synchronization boundaries while preserving the existing behavioral assertions. Do we have a high-confidence way to reproduce the issue? Yes, the source identifies the timing mechanism: response delivery precedes durable confirmation, while current main polls responses with an incidental deadline. The captured CI failures support that mechanism; this review did not execute tests. Is this the best way to solve the issue? Yes. Reusing the exact-response promise and the existing committed-completion event removes the premature assertions without increasing deadlines or weakening authentication coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3df982d2c345. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
|
Merged via squash.
|
Move only the suspended-exhaustion scenario into the existing broker-backed admission suite. Observe the real reconciliation attempt and stop it while admission remains suspended; preserve durable state and dispatch assertions. Wait for actual approval publication and task-lane completion in the hosted lifecycle fixture instead of polling worker-backed state. Keep the startup fix landed in #155006. Leave the exec/plugin agent-runtime cases to active #154977 and the two other exhaustion cases to #155007. This narrows our bot-owned repair without modifying those owners' PRs. No production changes, deadline increases, retries, or guard weakening. Final three-file proof: 231 tests pass in109.01s; full changed checks pass. Fresh canonical Codex autoreview through P3 is scoped-clean. The original suspended-case failure was reproduced with controlled worker lookup delay; prior admission proof includes20 repeated suite runs. Temporary delay instrumentation is not retained. Earlier broader-head CI is historical only. Co-authored-by: VACInc <[email protected]>
…enclaw#155006) * test(gateway): await startup connect responses * test(gateway): await committed setup confirmation
What Problem This Solves
Fixes timing-dependent startup WebSocket authentication tests that confuse response arrival with completion of the handshake's durable bookkeeping.
User Impact
No production or user-visible behavior changes. The tests retain their authentication, startup-error opacity, rate-limit, isolation, case-order, and admission-lifetime assertions.
Why This Change Was Made
Use the fixture's existing exact-response promise instead of its second polling/search path. For successful bootstrap cases, separately await the existing
device.pair.setup.completedevent and verify its setup and device identities before reading the database or closing the socket. That event is published only after confirmation commits; receivinghello-okis an earlier boundary. The separate admission-release wait and existing test and handshake deadlines remain unchanged. This removes four net test lines.Bootstrap verification now crosses an asynchronous SQLite worker boundary. The invalid-credential cases do not initialize that worker during token-issuance setup, unlike their successful siblings. That is a source-backed explanation for the exposed polling assumption, not a phase-measured attribution of the CI delay.
Evidence
confirmed, observeduncertain. The final change waits for the canonical completion event before those unchanged durable assertions.git diff --checkpassed. Independent P0–P2 review of the final staged candidate found no actionable findings. An earlier review identified an additional early-close case; it now awaits the same committed-completion event.307e85efeeapassed all 16 startup cases in their original order in CI35629040233, jobchecks-node-changed-compact-large-14. File duration was 38.44s including transforms; individual case durations total 7.36s. Both original failures and all five confirmation-race cases passed. The complete CI run, includingopenclaw/ci-gate, passed in 15m55s; startup-corpus validation (592s) owned its critical tail. This does not establish the eight-minute overall goal.The separate iOS scope workflow initially failed before checkout because GitHub action-download metadata timed out three times. One failed-job-only retry on the unchanged final head passed in 39s; the unaffected iOS scan was skipped. No source or timeout changes accompanied that infrastructure retry.