Repository navigation
stabilize layoutZoomEnvironment e2e test and break the zoom cascade - #17832
Merged
Merged
Conversation
The worker-scoped automation session shares one RStudio window across all specs, and resetForNextTest never cleared pane zoom. A layoutZoomEnvironment test that failed before toggling back left the Environment pane maximized, which squeezed the Packages pane to near-zero and made the following packages_pane specs' checkbox clicks time out as "not visible". - add window.rstudio.layout.reset() to the automation bridge; it ends any active pane/column zoom only when something is zoomed (so non-zoomed layouts keep their column widths) and returns a Promise that resolves once the relayout settles (the restore flushes on a later animation frame even under reduced_motion). PaneManager.endZoomIfActive threads a completion callback through restoreLayout. - call it from resetForNextTest and from an afterEach in tabs.test.ts so a leaked zoom can't poison the next spec. - rewrite the layoutZoomEnvironment assertions to test the zoom invariants (command-checked state + collapse of the other panes + tolerance restore) instead of a 1.5x growth ratio that coupled the test to the default column proportions and failed on smaller CI displays.
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.
Intent
Stabilize the
layoutZoomEnvironmentPlaywright spec and stop it frompoisoning later specs in the same worker. Three desktop e2e failures were
observed together:
tabs.test.ts-> layoutZoomEnvironment zoom/toggle poll timeoutpackages_pane.test.ts-> checkbox click timeout ("not visible")packages_pane.test.ts-> initial checkbox stateThere is no tracking issue; this addresses CI flakiness only. No product
behavior changes for users -- the only product-side addition is an
automation-only bridge surface (
window.rstudio.layout.reset()), active justunder
--automation-agent.Root cause
The Playwright suite runs with
workers: 1and a worker-scopedrstudioPage, so every spec shares one RStudio window.resetForNextTestreset modals, debug mode, and the source pane, but never cleared pane
zoom. When the
layoutZoomEnvironmentspec failed before toggling the zoomback off, the Environment pane stayed maximized -- which collapses the
Packages pane (same right column) to <50px. The following
packages_panespecs then ran against a zero-size checkbox, so
click()/toBeVisible()timed out. The three failures were one cascade, not three bugs.
Separately, the
layoutZoomEnvironmentassertions themselves were fragile:envWidth > initialEnvWidth * 1.5couples the assertion to the default columnproportions. On a CI display where the Source/Console column starts narrow
(the snap-threshold case the
1400x900window-bounds pin guards against), theEnvironment column is already wide, so zooming grows < 1.5x and the poll's
predicate is simply never true.
PaneManagerhas not changed since this testlast passed, so this is a test-assertion issue, not a product regression.
Changes
window.rstudio.layout.reset()(inApplicationAutomation).It delegates to
PaneManager.endZoomIfActive, which ends any activepane/window or column zoom only when something is zoomed (a non-zoomed
layout keeps its custom column widths). It returns a Promise that resolves
once the relayout has settled -- the restore flushes on a later animation
frame even under
reduced_motion-- by threading a completion callbackthrough
restoreLayout->restoreSavedLayout/restorePaneLayout.resetForNextTestnow un-zooms via the bridge, andtabs.test.tsun-zooms in an
afterEach, so a failed zoom spec can't poison the next one.layoutZoomEnvironmenttest to verify the zoominvariants -- the deterministic command-checked state, the collapse of the
Console / TabSet2 panes, and a tolerance-based restore -- instead of a growth
ratio (matching how
panes.test.tsverifies its column-zoom tests). Adds aloud precondition so a contaminated/too-small starting layout fails clearly
at setup rather than as a mystery poll timeout.
Validation
tsc --noEmitclean (e2e)ant javacclean (GWT)a GWT + desktop build to exercise).