Skip to content

e2e: keep a slow posit ai sign-in from failing the whole shard - #18780

Merged
kevinushey merged 1 commit into
mainfrom
test/e2e-harden-ai-auth-and-readline
Sep 11, 2026
Merged

kevinushey merged 1 commit into
mainfrom
test/e2e-harden-ai-auth-and-readline

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Intent

Two hardening changes prompted by the e2e failures on #18765, none of which were caused by that PR.

Approach

Auth setup (tests/auth.setup.ts). The submit password step was marked fatal, so any error there became a LoginAutomationError and failed the setup project, which left every dependent test in the shard as "did not run" (333 tests on the Linux server shard). The actual failure was a slow redirect after the click, not a rejected password: click() waits for the navigation it triggers under the runner's actionTimeout, which is 10s here (the runner applies the config's actionTimeout to contexts launched during a test, contrary to the comment that assumed a 30s library default).

  • Click with noWaitAfter so the existing 30s waitForURL owns the redirect budget.
  • Classify by error kind rather than by step: the step is fatal only when the login page shows a visible rejection message (an alert role or narrow text such as "incorrect" / "invalid"). A stalled redirect now falls through to the transient path, and the @ai tests skip with that reason in the status file rather than taking the shard down.
  • step() keeps a LoginAutomationError a step throws itself, so the fail-loud verdict for a real credential problem survives.

Readline test (readline-notification.test.ts). Its post-readline idle wait was the only 30s turn budget in the suite; every other wait settles for at least 60s. The assistant routinely keeps working after readline() returns (reads the console back, comments on the result), which is what failed on both macOS and Windows.

  • Raise that wait to 90s and set the test timeout to 300s so two turns plus the readline fit.
  • Spell out in the prompt that the code must be run with the executeCode tool and not written to a file, which is what the first macOS attempt did (the notification never appeared).

Testing

  • npm run typecheck in e2e/rstudio passes.
  • Neither path can be exercised locally without Posit AI credentials, so verification of the live behavior is via CI on this PR (the @ai suite and the auth setup run there).

Checklist

  • No NEWS.md entry (test-only change)

A slow redirect after submitting the password on login.posit.cloud was
classified as a credential failure (the step was marked fatal), which
failed the auth setup project and left every dependent test as "did not
run". Click with noWaitAfter so the 30s URL wait owns that budget instead
of the runner's 10s actionTimeout, and only treat the step as fatal when
the page actually shows a rejection message; a stalled redirect now falls
through to the transient path and the @ai tests skip.

Also give the readline-notification test the same settle window the rest
of the suite gives an assistant turn (the agent keeps working after
readline() returns), size its timeout for two turns, and spell out in the
prompt that the code must be run with the executeCode tool rather than
written to a file.
@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

1 test(s) failed

###################- 99% pass rate

Passed Failed Skipped Flaky
2683 1 184 3
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 674 0 38 1
✅ desktop-macos 680 0 33 1
❌ desktop-windows 678 1 39 1
✅ server-linux 621 0 44 0
✅ setup 28 0 20 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 1a4e59a1e26c71af1f8ff692758929a1efb642b5 - Run #932

@kevinushey
kevinushey merged commit 2309310 into main Sep 11, 2026
33 of 34 checks passed
@kevinushey
kevinushey deleted the test/e2e-harden-ai-auth-and-readline branch September 11, 2026 16:36
gtritchie added a commit that referenced this pull request Sep 12, 2026
* Match chat messages by role testid, not data-message-id (#18781)

PA 1.4.0 (#2395) added a per-turn footer that carries data-message-id and
renders after the message row, so messageItem.last() resolved to a cost and
timing row reading "8:54 PM" instead of the reply. Every chat test that
asserts on the last message failed on all three platforms, and the dead-turn
detector read those footers as non-substantive, reporting them as the provider
dropping turns mid-stream.

Match the ChatMessage row wrapper and the MessageRenderer content div instead,
so the locator tracks what a message is rather than what shares its id. The
matched set is unchanged against the currently released assistant, so the
suite runs against both it and the pre-release builds the gate exercises.

Route the two inline [data-message-id] locators in conversation-history
through the page object so there is one definition to keep correct.

(cherry picked from commit 9bae5ac)

* Tolerate U+200E in the skill-selection e2e assertion (#18782)

Posit Assistant 1.4.0 began prefixing every tool-call caption with U+200E
(LEFT-TO-RIGHT MARK) so that an rtl-truncated file path keeps its leading
slash on the left, in posit-dev/assistant d6d3901e7.

JavaScript's \s character class spans \u2000-\u200a and so does not match
U+200E. The assertion therefore failed against a rendered string that is
visually identical to what it expected, deterministically on Windows,
Linux and macOS in the 1.4.1 release gate.

Match the mark explicitly. The class also accepts the bare whitespace that
1.3.1 and earlier emit, so the test passes against both released versions.

(cherry picked from commit 904450a)

* e2e: keep a slow posit ai sign-in from failing the whole shard (#18780)

A slow redirect after submitting the password on login.posit.cloud was
classified as a credential failure (the step was marked fatal), which
failed the auth setup project and left every dependent test as "did not
run". Click with noWaitAfter so the 30s URL wait owns that budget instead
of the runner's 10s actionTimeout, and only treat the step as fatal when
the page actually shows a rejection message; a stalled redirect now falls
through to the transient path and the @ai tests skip.

Also give the readline-notification test the same settle window the rest
of the suite gives an assistant turn (the agent keeps working after
readline() returns), size its timeout for two turns, and spell out in the
prompt that the code must be run with the executeCode tool rather than
written to a file.

(cherry picked from commit 2309310)

---------

Co-authored-by: Kevin Ushey <[email protected]>

This branch had an error being deployed

1 failed deployment
e2e-playwright — 1a4e59a1 Deployed Sep 10, 2026 by kevinushey via windows / e2e-desktop-windows (4) #932
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