Repository navigation
e2e: fix four flakes from the pr-18229 all-platforms report - #18234
Merged
Merged
Conversation
Root-caused from the traces of the four flaky (pass-on-retry) tests in
the pr-18229 report:
- shinytest2.test.ts and build_pane_testthat.test.ts carried local
closeProjectIfOpen copies whose waits can all be satisfied against the
old page before the Server close-project reload navigates; the delayed
reload then lands during the next test's reset or suite fixture
(destroyed execution context; promptCount reset breaking
`count > before` waits). Use the shared utils/project.ts helper, which
blocks on window.rstudio.project.isActive() === false -- a signal only
the post-reload page can produce.
- terminal.test.ts located the send-to-editor tab by the contiguous
substring "expr 1 + 1", but with a long shell prompt xterm hard-wraps
the echoed command at an arbitrary column, even mid-word
("...$ exp" / "r 1 + 1" observed). Resolve the editor as the active
tab instead and compare with all whitespace and wrap markers stripped.
- global_prefs_panels.test.ts waited 15s for the Python interpreters
modal, which only opens after python_find_interpreters finishes
scanning; a cold runner can exceed that (the failure snapshot shows
the "Finding interpreters..." progress box still up). Give the wait a
discovery-sized timeout and drop the @desktop_only tag, since the
Server failure mode in #18064 matches this same slow scan.
Addresses #18064.
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root-causes and fixes the four flaky (pass-on-retry) tests from the pr-18229 all-platforms e2e report. All four are pre-existing harness races, unrelated to that PR.
Close-project reload race (2 flakes, server-linux)
shinytest2.test.tsandbuild_pane_testthat.test.tscarried local copies ofcloseProjectIfOpenwhose waits (waitForLoadState+ console visible + console idle) can all be satisfied against the old page before the Server close-project reload actually navigates. The delayed reload then lands during the next test's reset or suite fixture:perTestResetwith "Execution context was destroyed, most likely because of a navigation".createSandbox: the trace shows Enter pressed 13ms after the reload'sGET /; the reload resetwindow.rstudio.console.promptCount, so thecount > beforewait could never satisfy and timed out at 30s.Both files now use the shared
utils/project.tshelper, which blocks onwindow.rstudio.project.isActive() === false-- a signal only the post-reload page can produce.Terminal send-to-editor wrap (1 flake, server-linux)
terminal.test.tslocated the send-to-editor tab by the contiguous substringexpr 1 + 1, but with a long shell prompt xterm hard-wraps the echoed command at an arbitrary column, even mid-word (the failure snapshot shows...$ exp/r 1 + 1-- the terminal cwd was a long leftover sandbox path). The test now resolves the editor as the active tab (whichsendTerminalToEditoractivates) and compares with all whitespace and wrap markers stripped, which is invariant under any wrap position.Python interpreters modal timeout (1 flake, desktop-linux)
global_prefs_panels.test.tswaited a flat 15s for the Python interpreters modal, which only opens oncepython_find_interpretersfinishes scanning the machine; the failure snapshot shows the "Finding interpreters..." progress box still up at timeout, and the retry passed in under 4s. The wait now gets a discovery-sized 60s timeout. Since this same slow scan matches the Server failure mode recorded in #18064 (Group 3), the@desktop_onlytag is removed so this PR's e2e run verifies the test on Server again.Addresses #18064.
Verification
All four modified specs pass locally on macOS desktop (27/27, including the previously flaky tests);
npm run typecheckis clean. The server-linux behavior is exercised by this PR's all-platforms e2e run.