Skip to content

fix waitForSessionRestart marker false-pass during session resume - #18207

Merged
kevinushey merged 1 commit into
mainfrom
test/session-restart-ready-marker
Jul 13, 2026
Merged

kevinushey merged 1 commit into
mainfrom
test/session-restart-ready-marker

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Summary

The server-linux session_suspend.test.ts failure on PR #18203 (run 29273786621) traced back to a false-pass in waitForSessionRestart: the helper typed cat("<marker>") and checked output.includes(marker), but the submitted command is echoed into the console output, so the check passed off the echo even when the console input never reached R. In the failing run, the input came back as jsonrpc error 1 (Unable to connect to service) -- rserver's ConnectionError envelope while the suspended session was still relaunching -- yet the helper declared the session ready on its first attempt. The test's next executeInConsole({ wait: true }) input was swallowed the same way, so promptCount never advanced and the 30s wait timed out.

Changes:

  • Split the marker across two cat() arguments (cat("[pw:session-restart-", "ready <ts>]", sep = "")) so the joined marker can only appear as real R output, never in the command echo. A failed delivery now correctly falls through to the retry loop.
  • Use one timestamp for the whole call: rserver holds an undeliverable console input for up to rsession-proxy-max-wait-secs (default 30s) before failing it, so an early attempt's cat() may only execute during a later attempt's check -- any attempt's output confirms readiness.
  • Widen the retry budget from 3 attempts (~11s) to 12 (~45s): in the failing trace the session was unreachable for ~38s because the first reconnect RPC's relaunch raced the still-exiting session and its pending-launch entry suppressed relaunch attempts by subsequent RPCs until an RPC error cleared it (SessionManager::launchSession returns early for pending launches < 1 minute old).

Test-infra only; no NEWS entry.

Testing

  • npx tsc --noEmit in e2e/rstudio passes.
  • Verified against the failing run's Playwright trace: both failed inputs returned rserver's JSON-RPC error envelope over HTTP 200, and the console screenshot shows the echoed commands that satisfied the old includes() check.

The readiness check typed cat("<marker>") and looked for the marker in the
console output -- but the submitted command is echoed into the output, so the
check passed off the echo even when the console input never reached R (jsonrpc
error 1 "Unable to connect to service" while a suspended session was still
relaunching). The helper then returned "ready" while the session was down,
and the test's next executeInConsole wait timed out.

Split the marker across two cat() arguments so only real output matches, use
one timestamp per call so a late-delivered early attempt satisfies a later
check, and widen the retry budget to cover a slow relaunch (rserver can hold
each input for up to 30s before failing it).
@posit-snyk-bot

posit-snyk-bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
1809 0 66 4
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ desktop-linux 455 0 14 1
✅ desktop-macos 460 0 10 0
✅ desktop-windows 455 0 16 1
✅ server-linux 439 0 26 2
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 351abe67d887eed39742ca83e5f1dc9bacc6e2b0 - Run #150

@kevinushey
kevinushey merged commit d4df27b into main Jul 13, 2026
24 checks passed
@kevinushey
kevinushey deleted the test/session-restart-ready-marker branch July 13, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants