Repository navigation
e2e: fix split-editor reload and terminal listing flakes - #18509
Merged
Merged
Conversation
Two flakes seen in the pr-18508 all-platforms run; neither is caused by that PR. The split-editor reload test raced the ~5s client state push timer: a reload before the activeTabDocId push restores a stale active tab, so the document comes back as a background tab that is never laid out, and neither its text nor the split ever renders (flaked on all four platforms). Reuse the #17944 fix: wait for the set_client_state push carrying the active doc id before reloading. The helper moves from active_tab_restore.test.ts into utils/client-state.ts so both tests share it. The terminal listing test required the created filename to appear twice in terminalBuffer(), once from the echoed touch command and once from the ls output. terminalBuffer() returns physical lines, and on macOS CI the runner's GUID hostname makes the prompt long enough that the echoed command wraps mid-filename, dropping one match. Type the touch argument with a quote split so the echo can never contain the contiguous filename, and require a single intact match, which can then only come from the ls output (which starts at column 0 and cannot wrap).
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 |
…load-and-terminal-flakes
…load-and-terminal-flakes
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 the two flaky tests from the pr-18508 all-platforms e2e run (5 flaky results total, no hard failures). Neither flake is caused by #18508; both are test-side races.
split_editor.test.ts> the split is restored when the IDE reloads (flaked on all 4 platforms)The failure trace shows the reload's
client_initlanding ~2s afteropen_document, with noset_client_statepush in between. The active tab is persisted as theactiveTabDocIdclient state value on a passive ~5s timer, so the reload restored a stale value: the failure screenshot showssplit_editor.Rrestored but sitting behindUntitled1. A background tab is never laid out, so neither its text nor the split (applied on the deferred-layout path) ever renders, and the marker locator matched 0 views for the full 20s budget.Fix: wait for the
set_client_statepush carrying the active doc id before reloading, exactly asactive_tab_restore.test.tsalready does for #17944. The helper moves toutils/client-state.tsso both tests share one implementation.terminal.test.ts> a file created in the terminal appears in a directory listing (flaked on desktop-macos)The test required
ztestfile.txtto appear at least twice inrstudioapi::terminalBuffer(): once from the echoedtouchcommand and once from thelsoutput.terminalBuffer()returns one entry per physical line, and the screencast frames show the echoed command wrapping mid-filename (touch ztest/file.txt) -- the macOS runner's GUID hostname makes the prompt very long, and the terminal pane is narrow. Whether the wrap tears the filename depends on the random sandbox path length, hence the flake.Fix: type the touch argument with a quote split (
touch "ztest""file.txt", the same trickexpectTerminalRendersalready uses), so the echoed command can never contain the contiguous filename. A single intact match is then required, and can only come from thelsoutput, which starts at column 0 and cannot wrap -- so the assertion still proves the file was created and listed.Verification
Ran
split_editor.test.ts,active_tab_restore.test.ts, andterminal.test.tslocally against a desktop dev build: 16 passed / 0 failed.