Repository navigation
test(e2e): wait for the host snapshot to hold the baseline before capturing it - #17138
brennanb2025 wants to merge 1 commit into
Conversation
Greptile SummaryThe PR strengthens two Docker SSH hydration tests by waiting until the relay snapshot contains every seeded tab before continuing.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| tests/e2e/ssh-cold-hydration-gap-tab-seeding.spec.ts | The new polling helper matches the persisted remote-workspace schema and prevents stale snapshots from being captured before seeded tabs arrive. |
Reviews (3): Last reviewed commit: "test(e2e): wait for the host snapshot to..." | Re-trigger Greptile
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe SSH cold-hydration gap tab-seeding tests now parse persisted relay snapshots and extract tab IDs from Merge Risk: ⚪ Minimal · up to This test-only change waits for the remote snapshot to contain the expected tabs before validating hydration, reducing false failures without changing product behavior. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description gives a detailed technical explanation, testing status, failure analysis, and scope. However, it does not follow the required template structure and omits the required linked issue entry, explicit Testing section, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. It also provides a before/after table instead of the required visual proof or an explicit N/A statement. Resolution Add the required template sections and headings. Provide a valid linked issue after "Fixes #". Add the Testing checklist and retain the stated local and CI verification details. Add visual attachments for the behavior change, or write exactly "N/A" with a brief reason if no visual proof applies. Complete or explicitly mark the AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0a33e17 to
5f08f81
Compare
|
Closing as obsolete: main no longer has the code this PR changes, or already behaves as it intended. The only file it changes, tests/e2e/ssh-cold-hydration-gap-tab-seeding.spec.ts, was deleted by #27214 (ff27338), which removed the relay client (Stale-PR cleanup 2026-10-20, approved by Brennan. Reopen if something here is still missing on main.) |
Fixes the
ssh-cold-hydration-gap-tab-seedingspec so it captures the host snapshot only once that snapshot actually holds the tabs it is about to replay.ELI5
The test seeds three terminal tabs on a remote host, saves the copy of the workspace the host wrote down, quits, relaunches, and checks the three tabs come back. The catch: it only waited for the host's file to exist, never for the host to have finished writing the three tabs into it. When it grabbed the file too early it replayed a copy from before the tabs existed — an empty workspace — and the app then did exactly the right thing with an empty authoritative workspace: it replaced the tabs with none. The test reported
afterHydration=0and looked like the product had lost your tabs. It hadn't. The test handed it nothing.Now the test waits until the host's file actually lists all three tabs before capturing it.
The mechanism
use-app-session-persistence.tsfires it off the local session write asvoid localWrite.then(() => setForConnectedTargets(...)). Nothing the spec can await proves it landed.flushSessionBeforeQuit, waits onwindow.api.session.get()— the local write only.waitForUploadedRemoteSnapshotpolledls, i.e. existence, never contents.writeFileSyncto.tmp+renameSync,workspace-session-handler.ts), so a short capture is always a stale revision, never a torn one. That rules out a partial-write race and leaves exactly one cause.This is not a deadline extension
Nothing was stuck. The upload is a real in-flight operation the spec waited zero time for. The new wait reuses the existing 60 s
expect.pollbudget — no timeout was raised, no retry added, no assertion weakened. TheafterHydrationexpectation is untouched.Before / after
Who this affects: anyone whose pull request runs the
e2e / ssh docker watcher isolationlane.afterHydration=0, reading as a product tab-loss regression, and costs a rerunBoth tests in the file used the existence-only barrier, so both get the content barrier.
Measured rate
e2e / ssh docker watcher isolation, all attempts enumerated viafilter=all(not just the latest, which hides runs re-run to green), 2026-08-27T00:00Z → 2026-08-29T08:40Z, 388 job records / 32 failures:ssh-pi-compatible-agent-titlessh-lost-kill-tab-resurrectionssh-cold-hydration-gap-tab-seedingssh-startup-exec-readinessssh-port-forward-lifecycleFour of the five cold-hydration failures are this signature (
:158,baseline=3 duringStall=3 afterHydration=0, ~1.1 m each), the most recent at 2026-08-29T07:08Z. The fifth is an older revision of the spec.The 30 s multiplexer-timeout lead is refuted
ssh-channel-multiplexer.tsdoes carry a 30 sREQUEST_TIMEOUT_MS, but it is not what happens here. A timed-outworkspace.getresolvessnapshotto null, which takes thephase: 'offline'early return inremote-workspace-target-sync.ts— no apply, no replace, tabs stay at 3. The observed failure requires a successful apply of an empty snapshot. The absent timeout log line is consistent with that: no timeout occurred.Not verified locally
Docker is unavailable on the authoring machine, so neither Docker-SSH spec was run here; this rests on the CI record and on source reading.
pnpm tc(all projects),oxlint, both focused plugin audits with--deny-warnings,node config/scripts/check-changed-code-quality.mjs(0 new findings across 1 file), thepr-e2e-gate-contractsuite (37 passed), andgit diff --checkare all green. Local load average was 6–9 during those runs.Supersedes
#17031 diagnosed the same mechanism but asserted the capture after taking it, which renames the failure without removing it. This waits for the precondition instead, so the run passes. #17031 can be closed.