Skip to content

sanity: check webview resource loading - #342227

Merged
Martin Aeschlimann (aeschli) merged 10 commits into
mainfrom
agents/wsl-ssh-tests-regression-fix
Oct 19, 2026
Merged

Martin Aeschlimann (aeschli) merged 10 commits into
mainfrom
agents/wsl-ssh-tests-regression-fix

Conversation

@alexdima

@alexdima Alexandru Dima (alexdima) commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

The sanity tests did not catch #341396 (blank WSL webviews, 401 for wsl+Ubuntu), which shipped in 1.141.1. The UI sanity tests never opened a webview, so a webview resource loading regression could not fail them.

The investigation also found silently skipped WSL coverage and weaknesses in how WSL setup commands are run. Those changes have been extracted into the independent #342616. This PR now contains only the webview check and its documentation.

Changes

  • Webview check in every UI sanity test: open a Markdown preview, wait for its heading and then its inner document's load event, and fail on any .vscode-resource. response with an error status. Keep resource listeners attached until document loading finishes so delayed asynchronous script failures cannot escape detection. On failure, report the failed resources, network-level request failures and console errors.
  • Browsers that refuse webview service workers: Chromium on Debian 12 fails to register the webview service worker with NotSupportedError, so no webview can load there. In that exact case, log a pipeline warning and skip the check.

This does not re-enable unavailable WSL tests. Restoring native WSL coverage still requires resolving the Windows agent setup separately.

Validation

  • npm run compile --prefix test/sanity: passed, including after the WSL extraction.
  • npm run eslint -- test/sanity/src/uiTest.ts: passed for the unchanged webview implementation.
  • npm run eslint -- test/sanity/src/context.ts: passed after restoring the WSL runner to the base implementation.
  • Real Chromium regression checks of the actual preview method: the baseline misses a delayed 401; the fix rejects delayed 401 and 404 responses and waits for a delayed successful script. All four checks passed.
  • node test/sanity/out/index.js --commit 0b37947e9c38b74bfb12901f0fecfa18afea0766 --quality insider --grep '^(desktop-darwin-arm64|server-web-darwin-arm64)$' --verbose: passed, 2 tests.
  • Sanity pipeline 658 run 486075, before the WSL extraction, tested commit f8057c3e1a8 against Insider 341e0fa9346520e7a6a09803a80c5ecd3027f3cb. It completed partially succeeded. Six unrelated jobs failed: four Debian jobs could not install sudo because deb.debian.org was unreachable, openSUSE ARM64 failed repository metadata checksum verification while installing sudo, and the macOS ARM64 server failed Copilot shim notarization validation. These failures were not suppressed.
  • Earlier sanity run 485526 against Insider 0b37947e9c3: all Markdown preview checks passed or were skipped with the Debian 12 warning. Debian 12 server-web alone (run 485523) passed with the skip warning. Earlier local desktop-darwin-arm64-dmg also passed.
  • The webview implementation was verified unchanged by the split. Full cross-platform CI has not been rerun after extracting WSL changes.
  • Not validated: that the check fails on 1.141.1 inside WSL, because the WSL tests cannot run on the current agents.

WSL sanity tests have been silently skipped on Windows agents since the
Electron v42 update (#316661) forced WSL2: agents lack the WSL2 kernel, so
the Ubuntu import fails and the `wsl` capability is never detected.

- Fall back to importing Ubuntu with WSL1 when the default import fails
- Fail the job instead of skipping WSL tests when Ubuntu is unavailable
- Open a Markdown preview in UI sanity tests and fail on webview resource
  errors, which would have caught #341396 (401 for wsl+Ubuntu)

Co-authored-by: Copilot <[email protected]>
…e WSL on x64

The inbox wsl.exe on Windows Server 2022 exits with -1, which `if errorlevel 1`
does not detect, so the WSL1 fallback and the missing-distro check never ran
on x64 agents. ARM64 agents do not have WSL installed, so only warn there.

Co-authored-by: Copilot <[email protected]>
…1 import

A hung wsl.exe call blocked the Windows x64 sanity job until it hit the job
timeout, and the unresponsive agent dropped the step log. Run every wsl.exe
call in the setup script and the tests with a 5 minute timeout, and do not
try to convert Ubuntu to WSL2 after the import fell back to WSL1 on agents
without the WSL2 kernel.

Co-authored-by: Copilot <[email protected]>
Importing Ubuntu with WSL1 makes the Windows x64 WSL sanity tests hang, so
hold back the WSL1 fallback and the hard failure until the agents have the
WSL2 kernel. Until then, log a pipeline warning so that skipped WSL tests are
visible in the build summary instead of being skipped silently.

Co-authored-by: Copilot <[email protected]>
…iew service workers

Chromium on Debian 12 fails to register the webview service worker with
NotSupportedError, so no webview can load in that environment. Log a pipeline
warning and skip the check there instead of failing the job.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 17, 2026 03:25
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Base: 6b27fdc4 Current: a56e9b9c

No screenshot changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Resource monitoring can stop before loading finishes, allowing delayed failures to escape detection.

1 open issue
What changed in this PR

Adds webview resource checks to UI sanity tests and makes skipped WSL coverage visible, addressing gaps exposed by #341396.

Changes:

  • Open Markdown previews and report resource-loading failures.
  • Warn when webview checks or WSL tests are skipped.
  • Bound WSL commands and normalize setup failures.
File Description
test/​sanity/​src/​uiTest.ts Adds Markdown preview checks and diagnostics.
test/​sanity/​src/​runWsl.ts Adds a timeout-protected WSL wrapper.
test/​sanity/​src/​context.ts Bounds synchronous WSL calls.
test/​sanity/​scripts/​run-win32.cmd Uses the wrapper and warns about unavailable Ubuntu.
test/​sanity/​README.md Documents preview checks and timeout allowances.

Review effort: Balanced

Comment thread test/sanity/src/uiTest.ts Resolved
Move WSL command timeouts, setup failure normalization, and skipped-coverage warnings to #342616. Keep #342227 focused on webview resource loading coverage.

Co-authored-by: Copilot <[email protected]>
@aeschli Martin Aeschlimann (aeschli) changed the title sanity: check webview resource loading and surface skipped WSL tests sanity: check webview resource loading Oct 19, 2026
@aeschli
Martin Aeschlimann (aeschli) marked this pull request as ready for review October 19, 2026 18:03
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Dmitriy Vasyura (@dmitrivMS)

Matched files:

  • test/sanity/README.md
  • test/sanity/src/uiTest.ts

Martin Aeschlimann (aeschli) added a commit that referenced this pull request Oct 19, 2026
…2616)

Bound synchronous WSL calls and normalize setup failures, including negative exit codes. Warn when Ubuntu is unavailable rather than silently losing WSL coverage. Extracted from #342227.

Co-authored-by: Copilot <[email protected]>
Martin Aeschlimann (aeschli) added a commit that referenced this pull request Oct 19, 2026
Take WSL runner hardening from merged #342616 and leave Markdown preview coverage to #342227. Keep #342405 focused on WSL2 provisioning, installer caching, desktop launch ordering and connection readiness.

Use the shared bounded WSL helper for the new version probe.

Co-authored-by: Copilot <[email protected]>
Resolve the README timeout documentation conflict by preserving both the webview load checks and the WSL runner documentation now on main.

Co-authored-by: Copilot <[email protected]>
@aeschli
Martin Aeschlimann (aeschli) merged commit eed5625 into main Oct 19, 2026
49 checks passed
@aeschli
Martin Aeschlimann (aeschli) deleted the agents/wsl-ssh-tests-regression-fix branch October 19, 2026 19:41
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 19, 2026
Martin Aeschlimann (aeschli) added a commit that referenced this pull request Nov 2, 2026
#342405)

<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:

https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `main` branch.
* Include a description of the proposed changes and how to test them.
-->

Restores the Windows x64 WSL sanity tests by installing the pinned
current WSL release, including its WSL2 kernel, and fixing desktop
launch and connection readiness. This makes the WSL coverage in #342227
usable again, including its regression check for #341396.

## Scope and Related PRs

- #342616 is merged into `main` and supplies WSL command timeouts,
exit-code normalization, and missing-coverage warnings. This branch
merges current `main`; it no longer changes `context.ts` or `runWsl.ts`.
- #342227 exclusively owns the Markdown-preview/webview-resource check.
That code and its documentation have been removed from this PR;
`uiTest.ts` now matches `main` exactly.
- #342344 already supplies the shared WSL installer and checksum pin.
This PR consumes that installer rather than duplicating it.

The remaining diff is four files: the sanity pipeline template, the
Windows setup script, the WSL tests, and directly related README
updates.

## Remaining Changes

- Install the WSL release pinned in `build/checksums/wsl.txt` on Windows
x64 before importing Ubuntu. ARM64 installation behavior is unchanged.
- Cache the installer and include `build/checksums` in the pipeline's
sparse checkout.
- Set `WSL_UTF8=1` so redirected distribution names can be read
correctly.
- Convert Ubuntu to WSL2 only when needed, using the shared bounded
`Invoke-WslExe` helper for the new version probe. A timeout or nonzero
exit code is not treated as a successful probe.
- Fail and retry HTTP errors while downloading the Ubuntu rootfs.
- Pass `--folder-uri` last when launching the WSL desktop test, avoiding
Electron's refusal to accept arguments following a URL-like argument.
- Wait for the connected `WSL: ...` remote indicator rather than any
text containing `WSL`.
- Wait for WSL2 localhost forwarding through the existing retrying
`/version` fetch before navigating the server-web test.

## Validation

### Current Head

Merged `origin/main` at `72a22c9d71f` into the PR branch. The validated
PR head is `084ebfde057f18ec2436a984f75f60b48989d1e2`; the diff remains
limited to the four files described above.

- `pnpm --dir test/sanity exec tsc --noEmit`: passed.
- `pnpm run eslint test/sanity/src/wsl.test.ts`: passed.
- `git diff --cached --check`: passed.
- `git diff --check`: passed.
- `git commit`: passed, including the required pre-commit hygiene hook.

[Product build
491899](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=491899)
built and tested that exact PR head. **All nine Windows x64 sanity tests
passed**, including `wsl-server-x64`, `wsl-server-web-x64`, and
`wsl-desktop-x64`. Each WSL test executed once, without a test retry.
The log confirms WSL `3.0.3.0`, Ubuntu running as WSL2, the connected
`WSL: Ubuntu` indicator, and Markdown-preview coverage.

The overall build is **partially successful**, not fully green: native
Linux sanity attempted `desktop-linux-snap-x64` and received a 404
because this validation configuration disabled the Snap build. Windows
x64 sanity, Windows/Linux build stages, Web, and Publish passed.
Artifact publishing was enabled with approval; `VSCODE_RELEASE=false`
and no release stage ran.

### Historical Windows Evidence

Before removing the overlap, [Product Sanity Tests run
485962](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=485962),
against Insiders `341e0fa9`, passed all nine Windows x64 tests.
`wsl-server-x64`, `wsl-server-web-x64`, and `wsl-desktop-x64` all passed
on their first attempt.

The combined WSL2 provisioning and Markdown-preview check also caught
#341396: [run
485823](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=485823)
failed on buggy `c03d2e4a` with webview resource 401s, while [run
485824](https://dev.azure.com/monacotools/Monaco/_build/results?buildId=485824)
passed on fixed `16d22415`. The preview assertion now belongs only to
#342227; these are historical results, not a rerun of the simplified
head.
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.

5 participants