Repository navigation
run per-test e2e resets via auto fixture; capture client exceptions; pin test geometry - #17956
Merged
Merged
Conversation
ImageFrame.replaceLocation dereferenced el.contentWindow unconditionally; while the iframe is detached or being re-parented (e.g. a pane-layout quadrant swap moving the Plots pane, which short windows make more likely via the snap-to-minimize churn), contentWindow is null and the read threw an uncaught TypeError surfaced to the user as an error dialog. Report not-ready instead; the onLoad retry timer already repaints the stored URL once the frame has a window again.
…exceptions Three robustness fixes for the desktop e2e harness: - The per-test reset was registered as a module-scope test.beforeEach in rstudio.fixture.ts. Node caches the module per worker, so the hook only attached to the FIRST spec file each worker loaded -- every later file ran with no per-test reset at all, which is how a leaked Viewer maximize from rnotebook.test.ts hid the Environment tab for the next spec's first test. The reset is now an auto test-scoped fixture, which runs for every test in every file regardless of module caching. - Uncaught client exceptions are now recorded by the automation agent (window.rstudio.errors: message + stack + time, wrapping the default uncaught-exception handler) and drained after every test; a test that raised one fails with the stack in its output (opt out with PW_IGNORE_CLIENT_EXCEPTIONS=1). Previously the only artifact was an "Error" dialog with no stack, which the next reset silently dismissed. The reset also logs the text of any leaked modal dialog it dismisses. - The test window geometry is pinned to 1024x645 -- the macOS CI runner's display workArea, to which macOS silently clamps the previous 1400x900 request -- so local runs and CI exercise the same layout and geometry-sensitive bugs no longer surface only on CI. 800x600 was evaluated and rejected (cramps layouts; 7 test failures).
🍎 macOS Desktop E2E · ARM64❌ 1 test(s) failed
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · macos-26 ARM64 · commit |
kevinushey
added a commit
that referenced
this pull request
Jun 12, 2026
ScrollUtil.setScrollPositionOnLoad polled the preview frame's document from a 50ms Scheduler timer with no try/catch. When the frame is transiently cross-origin (mid-navigation or an interim error page), reading contentWindow.document throws a SecurityError, which killed the polling loop (so the scroll position was never restored) and surfaced as an uncaught client exception that fails e2e tests since #17956. Treat a throw like the other not-ready cases and keep polling, matching the guarded versions of this same access in RmdOutputFramePane.
kevinushey
added a commit
that referenced
this pull request
Jun 12, 2026
* add a clear-sort button to the data viewer status bar When a column sort is active, the "Sorted by: <column>" status at the right of the info bar now includes a small X button that clears the sort, restoring the frame's natural row order. The status element is split into a text span plus a persistent button so the button's click listener survives info-bar updates. * use theme-aware mask icons for clear-sort and clear-filter buttons * clarify clear-sort aria-sort comment; test cleared sort survives a refresh * guard rmd scroll-restore poll against unreadable viewer frames ScrollUtil.setScrollPositionOnLoad polled the preview frame's document from a 50ms Scheduler timer with no try/catch. When the frame is transiently cross-origin (mid-navigation or an interim error page), reading contentWindow.document throws a SecurityError, which killed the polling loop (so the scroll position was never restored) and surfaced as an uncaught client exception that fails e2e tests since #17956. Treat a throw like the other not-ready cases and keep polling, matching the guarded versions of this same access in RmdOutputFramePane.
kevinushey
added a commit
that referenced
this pull request
Jul 2, 2026
The useSuiteSandbox beforeAll start/done bracket and the createSandbox workdir echo were timeline instrumentation added in #17795 to correlate "Error Opening Project" / empty-dir failures against sandbox creation. That failure mode has since been root-caused (module-scope hooks vs fixtures, #17955/#17956), so the three lines are now just per-suite log noise. The real diagnostics stay: the empty-dir read warning (with stack) and the not-under-PW_SANDBOX warning.
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.
Fixes #17954. Fixes #17955.
Follow-ups from validating #17953 -- the residual environment-pane flake turned out to be a deeper harness defect, and chasing it surfaced a product bug.
Product fix (#17954)
ImageFrame.replaceLocation(Plots pane) dereferencedel.contentWindowunconditionally; during pane re-parenting (quadrant swaps, snap-to-minimize churn on short windows) it is null, and the read raised an uncaught TypeError shown to the user as an error dialog. Now reports not-ready, feeding the existingonLoadretry. Verified:pane_layout.test.tsgoes from 15/16 to 16/16 at 1024x640.Harness fixes (#17955)
test.beforeEachonly attached to the first spec file loaded per worker (Node module caching), so every later file ran without resets -- the actual mechanism behind the environment-pane first-test flake. Auto fixtures run for every test in every file. Verified: three files in one worker, resets fire for each file, all green at the geometry that previously reproduced the flake.window.rstudio.errors; the fixture drains it after every test (failing with the stack in the output;PW_IGNORE_CLIENT_EXCEPTIONS=1downgrades to warnings), and warns with contents for any leaked modal the reset dismisses. New harness self-test exercises the chain end-to-end viaerrors.simulate()(a real throw from a$entrycontext), including atest.fail()-inverted check that the fail-on-exception machinery actually fails tests.Verification
87 tests green locally at the pinned geometry in one run:
tests/harness,rnotebook+environment_pane(the CI failure sequence, same worker), all oftests/panes/layout, and all oftests/panes/data-viewer.ant javacand the e2e typecheck pass.