test(e2e): fix the project-rename flake at its root and run the suite once#443
Conversation
… once The E2E job reran all 16 spec files on any failure (a shell `until` loop), which was expensive, and the projectRename suite failed reproducibly deep in the shared VS Code run while passing in isolation. Root cause: leaveUnsavedCellEdit located the first code cell's view-line then clicked it as a separate step, so the cell re-rendering between locate and click threw a StaleElementReferenceError — far likelier when the shared instance is sluggish late in the run, where undismissed notification toasts had piled up. (My earlier retryable-setup wrapper masked this behind a misleading open-folder error; it is dropped in favour of the root fix.) - projectRename: locate and click the cell line in one retried step (from #375). - rootHooks.ts + .mocharc.js: a Mocha root afterEach dismisses notification toasts between tests so they do not accumulate across the shared instance. - e2e.yml: run the suite once (drop the until-loop whole-suite retry). Validated locally against the packaged VSIX under Xvfb, exactly as CI runs: full suite 54 passing, 0 failing, 1 pending in a single run; projectRename passes in-place (it failed 2/2 full runs before this fix). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELgnvYGB68gTtHncpWN588
77b6096 to
79bb170
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #443 +/- ##
===========================
===========================
🚀 New features to boost your workflow:
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe E2E workflow now runs the prebuilt suite once under Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
Comment |
Summary
Fixes the flaky
projectRenameE2E suite at its root and drops the expensive whole-suite retry. Surgical — 4 files.until … max=2shell loop ine2e.ymlthat reran all 16 spec files on any failure.projectRenamefailed reproducibly deep in the shared run but passed in a fresh instance.leaveUnsavedCellEditlocated the first code cell's.view-linethen.click()d it as a separate step; the notebook re-renders its cells on open, staling that reference before the click lands (StaleElementReferenceError) — far likelier when the shared instance is sluggish late in the run. It now locates and clicks in one retrieddriver.waitstep (the fix from feat(telemetry): add PostHog analytics for notebook usage events #375).waitForNotificationpolls every visible toast each tick, slowing later specs and overlapping the tree/menus/inputs they drive. A Mocha rootafterEach(test/e2e/rootHooks.ts, wired via.mocharc.js) now dismisses them between tests.Validation
Ran the full stack locally exactly as CI does — packaged the VSIX, downloaded test VS Code 1.111.0 + ChromeDriver, installed the built extension + the Python extension, under Xvfb:
it.skip).projectRenamepasses in-place — it failed 2/2 full runs before this fix.npm run compile-e2eclean;npm run format-fixclean.Known follow-up (not in this PR)
Running kernels/servers and global environments created by the cell-running suites are not torn down between suites. The run is green despite this now that the race is fixed, but fully isolating them means per-suite environment teardown, which re-provisions venvs and adds CI time — a separate cost/isolation decision.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ELgnvYGB68gTtHncpWN588
Summary by CodeRabbit
Bug Fixes
Tests