test: make session resume E2E retries reliable - #10588
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Architecture diagram
sequenceDiagram
participant Test as Playwright Test
participant Config as playwright.config.ts
participant App as Marimo App Server
participant Page as Browser Page
participant Kernel as Python Kernel
Note over Test,Config: Test Setup - Resolve App URL
Test->>Config: getAppUrl("shutdown.py")
Config->>Config: Look up server options
alt Edit command with dedicated port configured
Config->>Config: Use dedicated port URL
Config-->>Test: Return http://localhost:<dedicated-port>
else Edit command without dedicated port
Config->>Config: Use shared EDIT_PORT with ?file= query param
Config-->>Test: Return shared port URL
end
Note over Test,Page: Session Resume Flow
Test->>Page: Navigate to app URL
Test->>Page: maybeRestartKernel()
Page->>Kernel: Restart kernel if needed (clean state)
Page->>Kernel: Execute shutdown.py
Kernel-->>Page: Render form with initial output 'None'
Test->>Page: Wait for "'None'" text visible
Test->>Page: Fill form textbox with "12345"
Page->>Kernel: Submit form via button click
Kernel-->>Page: Process form data, render output
alt Output rendering
Page-->>Test: Show "'12345'" in second cell (exact match)
Page-->>Test: Show "54321" in second cell (exact match)
end
Test->>Page: Reload page
Page->>Kernel: Reconnect to existing session (resume)
Kernel-->>Page: Restore form state and output cells
Test->>Page: Wait for "You have reconnected to an existing session." visible
alt Session data preserved after reload
Page->>Kernel: Query resumed session state
Kernel-->>Page: Return restored values
Page-->>Test: Show "'12345'" in second cell (exact match)
Page-->>Test: Show "54321" in second cell (exact match)
end
Test->>Test: Take screenshot for evidence
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Coverage Report for ./frontend
File CoverageNo changed files found. |
There was a problem hiding this comment.
Pull request overview
This PR improves Playwright E2E reliability for the “shutdown session resume” scenario by ensuring explicitly ported edit-mode fixtures connect to their dedicated server, and by tightening the resume test’s setup/assertions to avoid stale session state and DOM races.
Changes:
- Update
getAppUrlto routeeditfixtures with an explicitportdirectly to that server (instead of the shared edit server). - Make the shutdown “resume session” test reset retry state via
maybeRestartKerneland assert resumed output more precisely within the target cell.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/playwright.config.ts | Routes explicitly ported edit apps to their dedicated server URL to avoid cross-test session leakage. |
| frontend/e2e-tests/shutdown.spec.ts | Stabilizes the resume-session E2E flow by restarting on resumed sessions and scoping assertions to the resumed cell. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
📝 Summary
The shutdown resume E2E test could connect to the shared edit server even though its fixture configured a dedicated port. Failed attempts also left resumable sessions behind, while page-wide text assertions raced with the restored form DOM.
This routes explicitly ported edit fixtures to their dedicated server and makes the resume test establish clean retry state before asserting exact output within the resumed cell. This keeps the test focused on session restoration and prevents stale sessions or duplicate locators from affecting retries.
📋 Pre-Review Checklist
✅ Merge Checklist