Repository navigation
playwright: replace blind sleeps with polled waits - #17739
Merged
Merged
Conversation
- executeInConsole gains { wait, timeout } -- polls the busy class
instead of having callers blind-sleep after every R command
- new .rs.ensurePackageInstalled (R) + ensurePackageInstalled (TS)
helper, skips reinstall when package is already on disk
- harden closeSourceAndDeleteFile to wait on both aceTextInput AND
selectedTab count == 0 (workaround for #17738: file.edit racing
closeAllSourceDocs)
- sweep blind sleeps in source/chat action helpers and the rmarkdown
/ s4_unloaded_package test files
s4_unloaded_package.test.ts: ~5 min -> 1.3 min
rmarkdown.test.ts: 2.1 min -> 58.6 s
suite-wide blind-sleep budget: -125 s
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. |
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.
Summary
{ wait, timeout }option toexecuteInConsole(free function and class method). Withwait: trueit polls therstudio-console-busyclass instead of having callers blind-sleep after every R command..rs.ensurePackageInstalled(R) andensurePackageInstalled(TS) so test setup can no-op when a package is already on disk -- replaces ~30 s of blindinstall.packageswaits ins4_unloaded_package.source_pane.actions.ts,chat_pane.actions.ts,rmarkdown.test.ts,s4_unloaded_package.test.ts.s4_unloaded_packagedrops from ~5 min to 1.3 min;rmarkdown.test.tsfrom 2.1 min to 58.6 s; suite-wide blind-sleep budget falls by ~125 s.closeSourceAndDeleteFileto wait on bothaceTextInput.toHaveCount(0)andselectedTab.toHaveCount(0)-- workaround for file.edit() can silently fail when invoked during an in-flight closeAllSourceDocs #17738 (file.editracingcloseAllSourceDocs).Test plan
npm run test:desktop-dev -- tests/panes/editor/rmarkdown.test.ts-- 6 passed in 58.6 snpm run test:desktop-dev -- tests/panes/misc/s4_unloaded_package.test.ts-- 4 passed in 1.3 min (covers R restart + RStudio restart paths)npx tsc --noEmitcleanchat_pane.actions.ts) -- run when AI credentials are set upcode_suggestions.test.ts-- not touched here; future follow-up once we settle a story for the stale NES gutter (NES gutter icon persists across file close/open cycles and applies stale suggestion to wrong file #17108)Filed #17738 for the underlying
file.edit/closeAllSourceDocsrace; this PR works around it test-side rather than fixing the IDE.