Skip to content

Fix flaky open-connect-content e2e test#3677

Draft
zackverham wants to merge 7 commits intomainfrom
fix-open-connect-content-flaky-test
Draft

Fix flaky open-connect-content e2e test#3677
zackverham wants to merge 7 commits intomainfrom
fix-open-connect-content-flaky-test

Conversation

@zackverham
Copy link
Collaborator

Replace URL change detection with direct explorer polling to handle both workspace switch code paths (updateWorkspaceFolders and openFolder). Consolidate 5 retryWithBackoff blocks into a single waitUntil loop with try-catch for page reload safety.

Intent

Type of Change

    • Bug Fix
    • New Feature
    • Breaking Change
    • Documentation
    • Refactor
    • Tooling

Approach

User Impact

Automated Tests

Directions for Reviewers

Checklist

  • I have updated the root CHANGELOG.md to cover notable changes.

zackverham and others added 7 commits March 9, 2026 17:18
Replace URL change detection with direct explorer polling to handle
both workspace switch code paths (updateWorkspaceFolders and openFolder).
Consolidate 5 retryWithBackoff blocks into a single waitUntil loop with
try-catch for page reload safety.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The connect-content filesystem provider's stat() call was blocked by
awaited UI dialogs (showErrorMessage, credential flow), preventing the
explorer from rendering the workspace folder during e2e tests.

- Move cache population before error notification in fetchAndCacheBundle
- Fire-and-forget showErrorMessage and credential dialog instead of awaiting
- Increase e2e waitUntil timeout to 120s and dismiss notification toasts
- Add unit tests verifying stat/readDirectory resolve on fetch failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Screenshots show the workspace switch never happens on preview and
2023.03.0 - the URL stays at /?folder=/home/coder/workspace. Adding
cy.log diagnostics to capture: content record values, URL after command,
explorer state, notification messages, and quick input visibility during
the waitUntil polling loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The workspace switch via updateWorkspaceFolders was silently failing
because code-server validates new workspace folders by calling stat()
on the root URI. The stat() call blocked on the bundle fetch (which
depends on Go backend readiness and Connect API), causing code-server
to reject the workspace change entirely.

Now stat() returns an immediate directory entry for root content URIs
(/{guid}) without waiting for the bundle. The bundle fetch is kicked
off in the background and the actual content loads lazily when
readDirectory() is called by the explorer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On Connect 2023.03.0, code-server was dropping the connect-content
workspace folder because readDirectory() blocked on the bundle fetch.
When the bundle takes too long (slow Connect API, Go backend startup),
code-server rejects the workspace change.

Now readDirectory() returns an empty list immediately for root URIs if
the bundle hasn't been cached yet, and fires a FileChangeType.Changed
event when the fetch completes to trigger VS Code to refresh the tree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In multi-root workspace mode (triggered by updateWorkspaceFolders in
code-server), the workspace name appears at aria-level 1 and the
connect-content folder drops to aria-level 2. The previous selector
only checked level 1, missing the GUID folder entirely.

Now the test searches for the GUID anywhere in the explorer tree
regardless of nesting level.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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