Skip to content

skip suggestion waits on a too-slow assistant; accept radio tip buttons - #19296

Merged
kevinushey merged 1 commit into
mainfrom
test/ai-e2e-flake-fixes
Oct 27, 2026
Merged

kevinushey merged 1 commit into
mainfrom
test/ai-e2e-flake-fixes

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Test-only fixes for two of the four flaky tests in the PR #19286 e2e run (report, run 40398345386). The other two (Citations: DataCite search on Linux, PubMed search on Windows) were the services hanging on the rsession's download.file; #19290 covers that case.

Ghost text accept (Posit AI, desktop-linux)

The Posit AI agent took 10s+ for every request in that window: both automatic next-edit requests came back empty after 10.3s and 10.6s, and the assistantRequestCompletions re-request issued by waitForSuggestion was answered {"cancelled": true} after 10.5s. That cancellation comes from the session, not the model: onBackgroundProcessing in SessionAssistant.cpp gives up on any agent request pending ~10s. With a backend that slow, no suggestion can arrive within the wait.

utils/assistant-requests.ts adds an AssistantRequestWatcher that pairs each /rpc/assistant_* async handle with its async_completion event and records whether the session cancelled it and how long it took. code_suggestions.test.ts runs one per test. When a suggestion wait fails, slowAssistantReason() skips the test via skipForAiServiceFailure if a request was cancelled and every answer that did arrive was slow (>= 5s). The second condition keeps a product regression visible: a session that stops relaying requests cancels all of them with no answers, and a fast answer next to a cancellation means the agent was keeping up. Otherwise the existing failUnlessAiServiceGone re-probe decides, as before.

Shiny tip calculator (desktop-windows)

The app rendered correctly, but the assistant built the four percentages with radioButtons("pct", ..., choices = c("10%" = 0.10, ...)). Those inputs carry value="0.1", so button:has-text("10%"), input[value="10%"] matched nothing. The check now matches a button or radio by accessible name, in both the R test and the Python draft.

Testing

  • New harness spec tests/harness/assistant-requests.test.ts (6 tests): the decision rule, plus the watcher against routed fake RPC and get_events traffic.
  • code_suggestions.test.ts ghost text accept + NES manual trigger and accept pass for GitHub Copilot against the installed daily (Posit AI skips locally: no credentials). A temporary log confirmed the watcher records real traffic there (three requests, answered in 86-371ms).
  • The Shiny change is unverified locally (Posit AI only); the accessibility snapshot in the failing run's error context shows radio "10%" etc., which the new locator matches.

Two flakes from the PR #19286 e2e run (40398345386):

- code_suggestions 'ghost text accept' (Posit AI, Linux): every agent answer
  took 10s+ and the session cancelled the re-request at its 10s cutoff. The
  suggestion waits now skip as a service failure when a request was
  cancelled and every answer that did arrive was slow.
- shiny-app-r (Windows): the assistant built the tip choices with
  radioButtons(), which the button-only locator could not match. Match a
  button or radio by accessible name instead.
@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
4451 0 224 2
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 14 0
✅ desktop-linux 1116 0 43 0
✅ desktop-macos 1121 0 38 1
✅ desktop-windows 1114 0 50 1
✅ server-linux 1062 0 51 0
✅ setup 36 0 28 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 8e40b76994c55d0034d16fc4de2519b0e8f9a3ac - Run #1742

@kevinushey
kevinushey merged commit 0437631 into main Oct 27, 2026
41 checks passed
@kevinushey
kevinushey deleted the test/ai-e2e-flake-fixes branch October 27, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant