Skip to content

Allow for homebrew's version of libboost - #3

Closed
knl wants to merge 1 commit into
rstudio:masterfrom
knl:brew
Closed

knl wants to merge 1 commit into
rstudio:masterfrom
knl:brew

Conversation

@knl

@knl knl commented Mar 19, 2011

Copy link
Copy Markdown

I have libboost installed via homebrew. Their version contains -mt at the end, so I modified the cmake script to recognize these variants.

@jjallaire jjallaire closed this Apr 6, 2011
@ivanacostarubio

Copy link
Copy Markdown

I'm happy for this

@alaimos alaimos mentioned this pull request Apr 24, 2020
4 tasks done
gtritchie added a commit that referenced this pull request Aug 6, 2020
On Centos7 (Desktop), unit tests were failing because global static initialization was causing access to an uninitialized string.

Fix by wrapping the static strings in functions.

The trigger is here: https://github.com/rstudio/rstudio/blob/e6fd9fd85f9088c13e8b2c5b78176111b4f2b485/src/cpp/core/LogOptions.cpp#L61

The crash stack was:
```
#0  0x000055ed09fbbdbe in std::string::size (this=0x55ed0b7d5188 <rstudio::core::(anonymous namespace)::s_homePathLeafAlias>)
    at /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.h:3817
#1  0x000055ed09fdc60c in std::operator==<char> (__lhs="~/.local/share", __rhs=<error reading variable: Cannot access memory at address 0xffffffffffffffe8>)
    at /opt/rh/devtoolset-7/root/usr/include/c++/7/bits/basic_string.h:6007
#2  0x000055ed0a97ce4c in rstudio::core::FilePath::resolveAliasedPath (in_aliasedPath="~/.local/share", in_userHomePath=...) at /src/src/cpp/shared_core/FilePath.cpp:476
#3  0x000055ed0a832e7f in rstudio::core::system::xdg::(anonymous namespace)::resolveXdgDir (envVar="XDG_DATA_HOME", defaultDir="~/.local/share", user=..., homeDir=...)
    at /src/src/cpp/core/system/Xdg.cpp:97
#4  0x000055ed0a833213 in rstudio::core::system::xdg::userDataDir (user=..., homeDir=...) at /src/src/cpp/core/system/Xdg.cpp:135
#5  0x000055ed0a8972ea in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /src/src/cpp/core/LogOptions.cpp:61
#6  0x000055ed0a89740c in _GLOBAL__sub_I_LogOptions.cpp(void) () at /src/src/cpp/core/LogOptions.cpp:347
#7  0x000055ed0aa9580d in __libc_csu_init ()
#8  0x00007f948396c4e5 in __libc_start_main () from /lib64/libc.so.6
#9  0x000055ed09fb44f5 in _start ()
```
kevinushey added a commit that referenced this pull request May 23, 2026
Two cross-file isolation fixes that resolved the remaining flakes in
debugger.test.ts (top-level breakpoint, Step Next), air_formatting.test.ts
(#3, #7), and editor.test.ts (trailing whitespace) when the full suite ran.

resetForNextTest:
- Bump the debug-exit waitFor from 5s to 15s and log a clear warning if it
  still misses. A 5s ceiling that silently swallows its timeout lets the
  next test run against a stale debug toolbar; waitForDebugMode then
  returns instantly and getActiveDebugLineRow looks for a marker in a
  hidden editor tab from the previous session.
- After resetSourcePaneState, require BOTH active doc being Untitled AND
  exactly one source tab remaining in the DOM before returning. The old
  wait was satisfied as soon as focus switched to the Untitled, often
  well before the close-all CPS chain had actually closed the other tabs.
  Lingering tabs (and their hidden Ace editors) were bleeding state into
  subsequent tests.

closeOptions (air_formatting):
- On toBeHidden timeout, check for the #rstudio_dlg_ok message-dialog
  button. attemptSaveChanges silently no-ops when any pane's validate()
  returns false AND that pane pops up an error modal via
  GlobalDisplay.showErrorMessage, leaving the prefs dialog wedged open
  forever. Re-raise with the modal's text so a recurring miss surfaces
  a precise reproducer instead of a generic toBeHidden error.
kevinushey added a commit that referenced this pull request May 23, 2026
…7755)

* playwright: sweep remaining blind sleeps + appearance theme guard

Replace remaining sleep(N) calls across e2e/rstudio/ tests with
deterministic waitFor / expect.poll style waits. Adds a
waitForActiveDocument helper in utils/commands.ts that polls
window.rstudio.documents.active() until the focused doc path matches,
useful as a post-condition for file.edit / documentOpen flows.

Also fixes a latent race in AppearancePreferencesPane.onApply:
themeList_ is populated asynchronously by setThemes(), so clicking OK
before themes load NPEs on themeList_.get(...). Skip the theme apply
when themeList_ is null -- the dropdown is empty in that case so
there's nothing the user could have selected.

For air_formatting.test.ts, closeOptions retries OK clicks up to 10x
at 200ms intervals to absorb the residual validate() race on dialog
close, warning on retry so any recurrence surfaces a precise
reproducer.

TextEditingTarget.reformat now collapses the selection on completion
(built-in and server paths) so the post-reformat state is observable
even when the formatter produced identical output.

* playwright + automation bridge: pref-RPC await, AppCommand-based restart

Bridge / Java
- ApplicationAutomation.setPrefValue / clearPrefValue now accept a JS
  callback wired to writeUserPrefs's completion. The bridge's set / clear
  return a Promise that resolves only after the setUserPrefs RPC lands on
  the server, so callers can be sure the pref is observable in R / the
  session-side cache before doing anything dependent on it.
- TextEditingTarget.withFormatContext drops cached air.toml only when the
  cache is empty AND useAirFormatter is enabled, falling through to the
  RPC path. Avoids false-built-in formatting when air.toml was created
  mid-session and the file monitor hasn't yet populated the cache.

restartSessionWithSentinel
- Switched from `.rs.api.restartSession(command = cat(...))` typed into
  the console to the restartR AppCommand via the bridge. The console_input
  RPC path was racing the in-flight shutdown, surfacing as
    Error: Unable to establish connection with R session when executing 'console_input'
  Readiness signal is window.rstudio.ready (flipped on
  RestartStatusEvent.RESTART_INITIATED -> false and
  DeferredInitCompletedEvent -> true) plus a waitForConsoleIdle tail.

Marker format
- All "session is up" markers now use `[pw:<event-name> <id>]`:
  restart-session-ready, project-opened, session-restart-ready. Three
  separate sources used to share the `__READY_<ts>__` prefix, which made
  cross-restart logs ambiguous.

Tests
- utils/commands.ts setPref / clearPref await the bridge Promise so the
  RPC has landed by the time they return.
- reformat.test.ts:105 uses an empty AceEditor marker -- the previous
  '# placeholder' marker stopped matching once Ctrl+A + type replaced the
  file's contents.
- rmarkdown.test.ts uses a 5s lead-in before checking the interrupt
  button has hidden post-restart (very short chunks were too brief for
  the polled expect-visible to catch).
- pane_location_persistence.test.ts restores the defensive
  "if (!isChecked) click" toggle after a reset link click; the prior
  expect.poll for true assumed sidebar-on-by-default, which isn't
  guaranteed.
- close_open_race.test.ts marks the View() race variant test.fixme;
  iframe loading during HIDE animation needs separate investigation.
- project_id.test.ts, create_projects.test.ts, project_trust_dialog.test.ts
  pick up the new marker format.

* air_formatting: drop closeOptions retry loop

The retry loop in closeOptions was actively breaking the test it was
meant to stabilize. attemptSaveChanges -> setUserPrefs RPC ->
onResponseReceived -> closeDialog is an async chain that takes a server
round-trip. The previous helper retried the OK click on a 200ms
toBeHidden window, which was nowhere near enough for the RPC to land --
so it would retry, find the OK button already gone from the DOM (the
*first* click actually worked), and hang on locator.click waiting for
actionability.

Diagnostic instrumentation revealed every retry was clicking against
"no #rstudio_preferences_confirm element in DOM" -- the dialog had
already closed.

Simplified to a single click followed by toBeHidden with a 15s window
that comfortably covers the RPC.

* playwright: isolate cross-file state in debugger + air_formatting

Two cross-file state leaks that surfaced as flaky failures only when
the full suite ran:

debugger.test.ts:94 / debugger.test.ts:206 (flake pattern: pass in
isolation, fail in full suite)
- Add a defensive "if R is in debug mode, get out" step to the beforeAll
  in both debugger.test.ts and debugger_extras.test.ts. A prior test file
  (or an earlier test in a serial chain whose resetAfterTest's stopDebug
  best-effort didn't fully drain) could leave R at Browse[N]>. Once that
  happens, the first waitForDebugMode returns instantly against the
  stale state and getActiveDebugLineRow throws "no visible debug line"
  because the debug marker is in a hidden editor tab from the previous
  session.

editor.test.ts:44 (trailing whitespace, flake pattern: pass in isolation,
fail in full suite)
- air_formatting.test.ts opened an 'air_formatting' project in beforeAll
  but had no afterAll to close it. Later test files inherited the open
  project context, and TextEditingTarget.maybeFormatOnUserInitiatedSave
  reads projConfig_.stripTrailingWhitespace() when a project is active
  -- which defaults to FALSE and silently overrides the global pref the
  test had just set.
- Adds an afterAll to air_formatting.test.ts that calls closeProjectIfOpen,
  documenting the cross-file contract.

* playwright: shared per-test reset helper

Add utils/test-reset.ts with resetForNextTest(page) and call it from the
shared beforeEach in fixtures/rstudio.fixture.ts. Centralizes the
recurring "make sure the prior test didn't leave broken state behind"
checks so individual test files don't have to repeat them.

What it covers:
- Save-changes dialog (Don't Save). Replaces the inline beforeEach in
  the fixture; previously was the only universal cleanup.
- R debug mode. A previous test that didn't drain its continueDebug /
  waitForDebugExit leaves R at Browse[N]>, which makes the next test's
  waitForDebugMode return instantly against the wrong session.
- Source pane buffers. resetSourcePaneState (kept-or-created Untitled +
  close everything else), specifically NOT closeAllSourceDocs so the
  pane never goes through the HIDE animation that races a following
  file.edit / View() (#17738).

What it explicitly doesn't cover (documented inline):
- Prefs. Tests own their own pref state in afterAll.
- Open projects. Some test files want a project context; the convention
  remains "the file that opens a project closes it in afterAll".
- Working directory. useSuiteSandbox already scopes cwd.

Each step short-circuits cheaply when its trigger isn't present, so the
common case (clean session) adds ~tens of ms per test.

Removes the now-redundant beforeAll defensive cleanup from
debugger.test.ts / debugger_extras.test.ts since the per-test reset
covers the same ground earlier.

* test runners: log Playwright launcher PID on start

A stuck full-suite run can take several minutes to abort cleanly because
the npx -> playwright -> worker -> Electron -> rsession process tree
respawns its children when individual levels are killed. Print the
launcher PID up front so users can kill the right process (the launcher
will tear down everything beneath it in one shot).

Switched runPlaywright from spawnSync to spawn for this -- spawnSync
returns after the child exits, which is too late for a "kill this to
abort" hint to be useful. The script's event loop stays alive via the
inherited stdio anyway, so we just register an 'exit' handler that
propagates the child's status and let the loop run.

Also fixes a latent gap where signal-killed runs (SIGTERM, SIGINT)
previously exited with whatever undefined-ish status spawnSync surfaced;
now we report 128 + signal number per shell convention.

* test-reset: wait for resetToUntitled to settle + restore console focus

Two follow-ups after wiring up the per-test reset:

1. Wait for the active doc to actually be Untitled (path === null) before
   returning. r.documents.resetToUntitled() dispatches a GWT event whose
   handler does its work asynchronously (closing tabs, possibly creating
   a new Untitled); page.evaluate returns the instant the dispatch
   enqueues, NOT when the handler finishes. Without the wait, a test
   running immediately after the reset could see the source pane mid-
   transition.

2. End the reset with `activateConsole` so every test starts with the
   console focused. resetToUntitled's handler moves focus to the kept /
   newly-created Untitled tab; the first test action that needs console
   focus (clearConsole, executeInConsole) would otherwise race that
   in-flight focus shift and time out in waitForConsoleFocus. This was
   surfacing as 5s failures on tests that just use the console
   (release-notes, ansi_erase_in_line) immediately after the per-test
   reset landed.

The settle-wait is best-effort (.catch swallows): a 5s miss falls
through to the activateConsole, and any latent staleness surfaces as a
more precise assertion failure in the test itself rather than a bare
reset-helper timeout.

* panes.test.ts: use closeAllSourceDocs to verify empty columns close

The 'Source columns can be created and closed' test creates three source
columns then asserts the column containers go away. #17716 swapped its
closeAllSourceDocs (the AppCommand, which closes empty columns as part of
its teardown) for documentCloseAllNoSave (the bridge call, which only
closes documents and leaves the column containers behind). That made the
assertions un-passable; the test had been failing since.

Revert the close path back to the AppCommand for this specific test --
documentCloseAllNoSave is still the right shape for the many other tests
that just want a clean source pane for the next test, but not when we're
asserting on the columns themselves.

* more tweaks

* test-reset: fully drain resetToUntitled + surface closeOptions blockers

Two cross-file isolation fixes that resolved the remaining flakes in
debugger.test.ts (top-level breakpoint, Step Next), air_formatting.test.ts
(#3, #7), and editor.test.ts (trailing whitespace) when the full suite ran.

resetForNextTest:
- Bump the debug-exit waitFor from 5s to 15s and log a clear warning if it
  still misses. A 5s ceiling that silently swallows its timeout lets the
  next test run against a stale debug toolbar; waitForDebugMode then
  returns instantly and getActiveDebugLineRow looks for a marker in a
  hidden editor tab from the previous session.
- After resetSourcePaneState, require BOTH active doc being Untitled AND
  exactly one source tab remaining in the DOM before returning. The old
  wait was satisfied as soon as focus switched to the Untitled, often
  well before the close-all CPS chain had actually closed the other tabs.
  Lingering tabs (and their hidden Ace editors) were bleeding state into
  subsequent tests.

closeOptions (air_formatting):
- On toBeHidden timeout, check for the #rstudio_dlg_ok message-dialog
  button. attemptSaveChanges silently no-ops when any pane's validate()
  returns false AND that pane pops up an error modal via
  GlobalDisplay.showErrorMessage, leaving the prefs dialog wedged open
  forever. Re-raise with the modal's text so a recurring miss surfaces
  a precise reproducer instead of a generic toBeHidden error.
kevinushey added a commit that referenced this pull request May 24, 2026
- chat-guardrails #3: require both a refusal/blocking signal AND
  path-scope context in the response. A bare refusal of the prompt's
  "no built-in tool" instruction would otherwise satisfy the earlier
  matcher without actually exercising the outside-path R guardrail.

- chat_set_update_check_override: consume the override after the next
  chat_check_for_updates returns it, matching the documented "next
  response" semantics. Previously the value persisted until explicitly
  cleared, so a forgotten clear in a test's afterEach could bleed
  forced results into unrelated subsequent checks.

- ChatPresenter docstring: drop "update-check-failed" (and add the
  missing "restarting") so the documented state set matches the values
  actually emitted by setAutomationChatState.
kevinushey added a commit that referenced this pull request May 24, 2026
…7760)

* playwright: add openProject automation bridge helper

Add window.rstudio.project.open(path) to the automation bridge, dispatching
SwitchToProjectEvent with forceSaveAll=true so a save-changes prompt can't
deadlock automation. Going through SwitchToProjectEvent directly skips the
confirm-open and project-options-reentry branches in Projects.java.

createAndOpenProject now uses the new bridge helper instead of writing an
.Rprofile sentinel marker and polling console output for it. The readiness
signal is the same window.rstudio.ready flag the rest of the bridge already
relies on (flipped on the new session's DeferredInitCompletedEvent), and the
.Rproj file creation collapses to a single console roundtrip.

* playwright: seed AI credentials by default + drop dead sleeps

Seed AI provider credentials by default when the host has them. Previously
the PW_SANDBOX_SEED_POSITAI / PW_SANDBOX_SEED_COPILOT env vars were opt-in;
now globalSetup copies ~/.positai/ and/or the GitHub Copilot config dir
into the sandbox user-home automatically when those source dirs exist. It
sets PW_AI_SEEDED_POSITAI=1 / PW_AI_SEEDED_COPILOT=1 to advertise the
result. PW_SANDBOX_NO_SEED_CREDENTIALS=1 opts out for hosts that aren't
dedicated test accounts.

Add utils/ai-credentials.ts exporting requireAiCredentials(test, provider).
Each @ai test.describe calls it; tests skip with a clear "no credentials
seeded" reason when the matching PW_AI_SEEDED_* flag is unset, replacing
what was previously a 5-minute mysterious timeout when the host had no
credentials and the test waited for a completion that would never arrive.

Drop nine dead-weight sleeps from code_suggestions.test.ts. Each was
immediately followed by an expect().toBeVisible(...) or toHaveCount(0,
...) whose own timeout already gated on the right condition, so the
intervening sleep was pure latency. ~16s saved per provider, ~32s across
the parameterized suite.

* rstudio-run-playwright-tests skill: streamline test-run protocol

Skip the per-run "ready to test" confirmation prompt -- after picking a
mode, just run. Surface test:desktop-dev first in the mode list when a
build/ directory exists at the repo root, since a developer with a local
build typically wants to test against it.

* playwright: address roborev review for branch

Three findings from roborev job 674:

- openProject() now also waits for the console-busy class to clear after
  ready=true, mirroring restartSessionWithSentinel. Without this a caller
  could land a console action into a still-busy post-switch session.
- requireAiCredentials() gates on a strict `=== '1'` comparison and
  sandbox-setup clears PW_AI_SEEDED_POSITAI/COPILOT before deciding
  whether to seed, so a stray "0" / "false" / inherited value can't smuggle
  past the skip check.
- ApplicationAutomation now also resets window.rstudio.ready on
  OpenProjectErrorEvent. project.open() preemptively flips ready=false to
  close the kQuit-arrival window; on the failure path ready would
  otherwise stay false forever and the helper would time out instead of
  surfacing the real error.

* playwright: drive trust overlay + wait for chat-ready in setup

dismissSetupPrompts now polls until the chat textarea is actually enabled
(the only real "ready" signal), clicking through the TrustOverlay modal
along the way. Previously it returned as soon as install/update/trust
buttons were handled in a one-shot snapshot, leaving every downstream
test to time out on a disabled textarea when the trust dialog rendered
late or when seeded credentials were stale.

waitForChatReady fails fast with an actionable message if a Sign-In
button appears, since the test harness has no OAuth path -- a stale
refresh token (rotated by the host between globalSetup and test
execution) used to surface as a 15s "textarea disabled" timeout in
every chat test; now it surfaces once with "sign in on the host and
re-run".

* playwright: scope chat-guardrails #3 to R-side guardrail outcome

Test 3 ("write outside project directory is denied") was asserting file
absence on disk, but the assistant has a built-in write tool that isn't
subject to .rs.chat.withGuardrails -- so the file existed when the
assistant used it. Check the conversational outcome (R guardrail
"blocked" error or pre-emptive refusal) instead, since R-side
enforcement is what this test claims to cover and is also covered
deterministically by chat-guardrails-paths.test.ts.

* chat: expose state surface + automation override for tests

Two related additions to make ChatPresenter blocking states observable
and controllable from Playwright tests:

1. window.rstudio.chat.{state,blocked,history}
   ChatPresenter writes its lifecycle state (ready / starting / restarting
   / manifest-unavailable / unsupported-protocol / incompatible-version /
   version-update-required / version-no-update / not-installed /
   update-available / assistant-not-selected / error / crashed) into
   window.rstudio.chat at each transition. Tests poll a deterministic
   value instead of racing the iframe content, which the live PAI backend
   actively re-renders. No-op outside --automation-agent mode.

2. chat_set_update_check_override RPC + window.rstudio.chat.setUpdateCheckOverride()
   Installs (object) or clears (null) a static override that the next
   chat_check_for_updates returns verbatim. Tests use this to drive each
   blocking branch without faking HTTP responses -- Playwright route.fulfill
   produces status=0 in the renderer's XHR in dev-mode Electron, so any
   JS-side mock takes ChatPresenter down the onCheckFailed path instead
   of the manifest-unavailable / unsupported-protocol / etc. callbacks
   the tests need to exercise. The in-rsession override is the only path
   that reliably reaches those callbacks.

* playwright: drive deprecate-pai-blocking via in-rsession override

Rewrites the deprecate-pai-blocking suite to assert on
window.rstudio.chat.state (deterministic, populated by ChatPresenter at
every transition) and install per-test response overrides via the new
chat_set_update_check_override RPC. The previous mechanism mocked the
RPC at the HTTP layer with Playwright route.fulfill plus a doc.write
hack to inject blocking HTML directly into the iframe; both fought the
live chat backend and only worked when the chat was stuck on the trust
overlay (i.e. only before the workspace-trust dismissal was wired up).

Side effects:
  - The Playwright RPC interceptor (interceptUpdateCheck /
    setUpdateCheckMock / clearUpdateCheckMock) and the UpdateCheckResult
    type are unused now; removed from ChatPaneActions.
  - Test runtime drops from ~21s (with one passing and one failing) to
    ~16s with all six tests green.

* playwright: address roborev review (jobs 677 + 678)

- chat-guardrails #3: require both a refusal/blocking signal AND
  path-scope context in the response. A bare refusal of the prompt's
  "no built-in tool" instruction would otherwise satisfy the earlier
  matcher without actually exercising the outside-path R guardrail.

- chat_set_update_check_override: consume the override after the next
  chat_check_for_updates returns it, matching the documented "next
  response" semantics. Previously the value persisted until explicitly
  cleared, so a forgotten clear in a test's afterEach could bleed
  forced results into unrelated subsequent checks.

- ChatPresenter docstring: drop "update-check-failed" (and add the
  missing "restarting") so the documented state set matches the values
  actually emitted by setAutomationChatState.

* playwright: verify executeInConsole submission, retry on stuck input

executeInConsole writes to the Ace editor and presses Enter, but Enter
can be intercepted by an autocomplete/signature-help popup that takes
the keystroke for selection rather than submission. When that happens
the command sits in the editor and R never goes busy, so the existing
waitForConsoleIdle wait returns immediately on an idle R and downstream
captureResult-style helpers throw "markers not found" with no context
about what actually broke.

Now: after each Enter, poll for the editor value to clear (Ace empties
the buffer on submit). If it's still populated, dismiss any popup,
re-focus the editor, and try again, up to 3 attempts. After the final
attempt fails surface a clear error including the command prefix so the
failure is diagnosable instead of bubbling up as an unrelated downstream
timeout.

* playwright: tighten executeInConsole retry handling

Two refinements to the executeInConsole retry loop:

- Cover all Enter-intercepting overlays on retry, not just the
  completions popup. On the first attempt we still only dismiss
  #rstudio_popup_completions if it's already visible (setValue
  shouldn't have created a new overlay). But once Enter has failed
  to submit, send Escape unconditionally to clear whatever overlay
  intercepted it (completions, signature help, hover tooltip, ...)
  and then re-focus the editor.

- Only retry on TimeoutError. Other waitForFunction failures
  (frame teardown, exec-context destroyed, JS evaluation errors)
  were being swallowed and replaced by the generic submission-failure
  message, masking the root cause. Re-throw non-timeout errors
  immediately.

* playwright: ensure each new source column has a doc before close-all

The "Source columns can be created and closed" test was relying on
closeAllSourceDocs to tear down empty source columns. That's not what
the product actually does -- a source column is removed only when its
last tab is closed (via LastSourceDocClosedEvent firing from
SourceColumn.closeTabIndex). newSourceColumn auto-populates only the
FIRST new column (the "always have a source doc when source view is
shown" invariant); columns 2 and 3 stayed empty, the close had nothing
to close in them, and they persisted -- then the empty columns got
re-populated with fresh Untitled docs during the assertion wait,
producing a misleading "Source2_pane count 1 expected 0".

Add an ensureDoc helper that clicks the new pane (focusing it as the
active column) and then runs newSourceDoc if the pane started empty.
Every column now has a doc by the time closeAllSourceDocs fires, so
every column's LastSourceDocClosedEvent fires and every column is
removed.

* playwright + chat: address critical-code-reviewer findings

Six fixes from the critical review of #17760:

- Gate chat_set_update_check_override on --automation-agent. The RPC was
  callable by any authenticated client in any session; in Server mode that
  would let a logged-in user pin chat_check_for_updates to return false and
  suppress legitimate update notifications. The handler now returns
  operation_not_permitted unless rsession started with the automation flag.

- Move the stranded openProject docstring above the actual function. It
  was sitting above getChatState, so JSDoc tooling and human readers
  associated the openProject docs with the wrong function.

- Tighten the waitForChatReady sign-in error. The previous message
  speculated about refresh-token rotation; now it just states the
  precondition and the action ("Sign in on the host (~/.positai) and
  re-run.").

- Anchor triggerRecheckAndExpectState (and the recovery test's ready
  assertion) on the LAST history entry rather than the current state. A
  transient transition can no longer satisfy the assertion -- the last
  recorded entry must match both state and blocked.

- Narrow requireAiCredentials's TestType from <any, any> to <{}, {}> so
  the helper doesn't launder any through utility code. {} (not unknown,
  which fails the TestType constraint) is the minimum that accepts
  extended-fixture `test` objects.

- Add a comment to panes.test.ts ensureDoc flagging the undocumented
  click-to-activate dependency, so a future test debugger knows where to
  look if newSourceDoc starts landing in the wrong column.

* playwright: normalize panes.test.ts source pane to one Untitled

The "Default quadrants exist and have expected visibility" test was
asserting the source pane is collapsed (0 width OR 0 height) at startup,
on the premise that "no source docs are open" in the default state. That
premise was wrong: RStudio's session-init creates a default Untitled tab
asynchronously, not gated on DeferredInitCompletedEvent, so a fresh-session
isolation run reliably sees Untitled1 in the source pane by the time
assertions run. The test only passed in the full non-AI suite because
preceding files happened to leave the source pane in an unusual 0-doc
state that didn't naturally occur on init.

Sidestep the race entirely: use documents.resetToUntitled() in beforeAll
to land the pane in a deterministic "exactly one Untitled" state (the
helper already exists and is used elsewhere for the same reason), poll
for that state to settle, and rewrite the source-pane assertion to match.
The pane is now expected to have dimensions > 0 and exactly one tab. No
close-and-reclose dance, no timing windows -- the bridge call leaves the
source pane in a known state and the assertion verifies it.

Side effect: the column-management test that comes next now starts from
the same canonical state instead of relying on whatever auto-Untitled
behavior happened to fire.
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.

3 participants