Repository navigation
advance console promptCount on any new prompt, not just top-level - #18061
Merged
Merged
Conversation
executeInConsole({wait:true}) waits for window.rstudio.console.promptCount
to increase. The bump was gated on !prompt.getBusy(), so it only fired at
the top-level prompt. A command that parks at an interactive sub-prompt
(browser()/Browse[N]>, readline(), menu()) never returns to top level on
its own, so the wait hung until timeout -- this broke the debugger e2e
tests, whose commands hit a breakpoint and enter Browse mode.
Bump on every ConsolePromptEvent instead. This is safe: a single
submission's intermediate continuation (+) and inter-statement prompts are
serviced from the server's buffered, line-split console input
(SessionConsoleInput.cpp rConsoleRead -> popConsoleInput) without firing a
client kConsolePrompt event, so a new prompt event is always a genuine "R
is waiting for input again" point, never a mid-expression state. One-shot
expressions still fire exactly one event at completion (the #18048 race
stays fixed); interactive/debugger commands now resolve at their settle
point instead of hanging.
🍎 macOS Desktop E2E · ARM64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · macos-26 ARM64 · 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.
Summary
executeInConsole({wait:true})(e2e helper) waits forwindow.rstudio.console.promptCountto increase. The bump was gated on!prompt.getBusy(), so it only advanced at the top-level>prompt. A command that parks at an interactive sub-prompt --browser()/Browse[N]>,readline(),menu(),scan()-- never returns to the top level on its own, so the wait hung until the 30s timeout.This broke the debugger e2e tests: they submit a breakpoint-triggering call (e.g.
brace_fn()) that enters Browse mode, then assert debug state. The submission never reaches a top-level prompt, sowaitForConsoleCommandCompletetimed out. The failures surfaced in #18059's CI (6 debugger specs, both retries) but were not caused by that PR -- its merge just includes thepromptCountchange from #18048, and it is the first PR exercising the debugger specs against that code.Fix
Bump the counter on every
ConsolePromptEvent(drop the busy gate inApplicationAutomation.registerConsole()).This is safe, and the key reason the original busy gate was unnecessary: a single submission's intermediate continuation (
+) and inter-statement prompts never reach the client. The server splits multi-line/multi-statement console input into per-line entries (fixupPendingConsoleInput) and services them directly from its buffer inrConsoleReadviapopConsoleInput()without firing akConsolePromptevent -- a client event fires only once the buffer drains and R genuinely stops to wait for new input. So a new prompt event is always a real "R is waiting for us again" point, never a mid-expression state.Behavior delta:
writeLines(...)case fix readr Import Dataset preview on Windows (escape generated R path) + console-wait reliability #18048 fixed): still fire exactly one event at completion -> identical behavior; the race stays fixed because it keys off a prompt event, not the sampled busy CSS class.waitForConsoleCommandCompletenow means "R stopped to ask for input again," not strictly "returned to top level" -- which is exactly what the debugger tests want.Verification
waitForConsoleCommandComplete, and the trace shows the debug toolbar visible inafterEach(the breakpoint did fire / R entered Browse). Server-sidebusy = !isAtTopLevel(), so aBrowse[N]>prompt carriesbusy == trueand was excluded by the old gate.promptCountbridge is unreleased e2e-test infrastructure, not user-facing.ant javac(trivial block-lambda -> expression-lambda over an existing method). CI will compile and re-run the debugger specs.Addresses the debugger e2e failures reported in #18059.