Repository navigation
ci: install current WSL on Windows smoke agents to fix flaky WSL setup - #342344
Merged
Alexandru Dima (alexdima) merged 7 commits intoOct 18, 2026
Merged
Conversation
The Windows PR smoke step that provisions WSL flaked 16 times between Oct 10 and 17. Every flake happened inside the runner's WSL2 VM, never in a download: either wsl --import hung until the step timed out (9), or apt-get/containerd crashed right after the first boot (7). A re-run on a new VM passes. Provisioning only sets up test infrastructure, so in PR CI a failure no longer fails the job. The WSL suite skips itself at runtime, so the shard split doesn't change. Lower the setup timeout from 15 to 10 minutes, since a healthy setup takes under 2. The Azure DevOps product build still requires the suite. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrow fallback preserves shard registration and strict checks outside the explicitly tolerated provisioning-failure path.
No open issues 🎉
What changed in this PR
Makes WSL provisioning failures non-blocking in Windows PR smoke tests while preserving strict Azure DevOps coverage.
Changes:
- Tolerates provisioning failures and shortens the setup timeout.
- Skips the affected suite at runtime without changing shard assignments.
- Documents the fallback behavior.
The tolerated-failure path has not yet been exercised in real CI.
| File | Description |
|---|---|
| test/smoke/src/areas/agentsWindow/agentsWindow.test.ts | Skips required WSL tests when provisioning explicitly fails. |
| .github/workflows/pr-win32-test.yml | Passes setup outcome, tolerates failures, and adjusts timeout and cleanup handling. |
| .github/skills/smoke-tests/SKILL.md | Documents runtime skipping and unchanged product-build requirements. |
Review effort: Balanced
The Windows Server 2022 agents only have the inbox WSL (wsl.exe 10.0.20348). With the 2021 standalone WSL2 kernel (5.10.16), its utility VM intermittently hangs on import, shuts down right after boot, or crashes processes such as apt-get and containerd. Earlier fixes (#337229, #337644, #338047) worked around single symptoms. - Install the WSL release pinned in build/checksums/wsl.txt (3.0.3) from build/azure-pipelines/common/wsl.psm1, verifying its SHA256 and Microsoft signature, and log the host CPU and WSL versions. - Cache the installer by that pin: actions/cache, filled on main by pr-node-modules.yml, and Cache@2 in the product build. This replaces the daily kernel installer cache. - Run every wsl.exe call with a timeout, so a hung import is retried on a fresh utility VM and diagnostics and cleanup can't hang. - Retry downloads on all errors. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ore merge) Co-authored-by: Copilot <[email protected]>
100 of 100 probe VMs provisioned WSL successfully in 92-124 seconds. Co-authored-by: Copilot <[email protected]>
…te test The kernel cache day and kernel installer cache steps were replaced by a single version-keyed WSL installer cache. Co-authored-by: Copilot <[email protected]>
Alexandru Dima (alexdima)
added a commit
that referenced
this pull request
Oct 18, 2026
Skipping the WSL Dev Container suite after a failed setup hid real regressions in the setup or the WSL path behind a green job. It was a stopgap while setup flaked on the inbox WSL; with current WSL installed, a failed setup should fail the PR. Restore the 15-minute step timeout so the bounded import retries have room. Co-authored-by: Copilot <[email protected]>
Alexandru Dima (alexdima)
marked this pull request as ready for review
October 18, 2026 19:58
Alexandru Dima (alexdima)
enabled auto-merge (squash)
October 18, 2026 19:58
Sandeep Somavarapu (sandy081)
approved these changes
Oct 18, 2026
Alexandru Dima (alexdima)
deleted the
agents/fix-flaky-wsl-dev-container-ci-step
branch
October 18, 2026 20:10
Alexandru Dima (alexdima)
added a commit
that referenced
this pull request
Oct 19, 2026
Bryan Chen (bryanchen-d)
added a commit
that referenced
this pull request
Oct 22, 2026
None of the 17 Cache@2 steps in the product build retried, so one transient pipeline-cache error failed the whole job even though every restore has a miss fallback. Over 90 days of main and release builds: - 8 builds failed on `Too Many Requests` (429) from the cache service, 2 of them in the post-job save - 487166 (official insider) lost Windows ARM64 Compile when the built-in extensions restore timed out after ~15 min of blob retries - 11 builds hit connection refused in a WSL cache restore that has since been removed (#342344) Add `retryCountOnTaskFailure: 2` to every Cache@2 step. A failure that survives both retries still fails the job: Cache@2 has no fail-open input, and `continueOnError` would turn the build partial. Co-authored-by: Copilot <[email protected]>
Bryan Chen (bryanchen-d)
added a commit
that referenced
this pull request
Oct 22, 2026
None of the 17 Cache@2 steps in the product build retried, so one transient pipeline-cache error failed the whole job even though every restore has a miss fallback. Over 90 days of main and release builds: - 8 builds failed on `Too Many Requests` (429) from the cache service, 2 of them in the post-job save - 487166 (official insider) lost Windows ARM64 Compile when the built-in extensions restore timed out after ~15 min of blob retries - 11 builds hit connection refused in a WSL cache restore that has since been removed (#342344) Add `retryCountOnTaskFailure: 2` to every Cache@2 step. A failure that survives both retries still fails the job: Cache@2 has no fail-open input, and `continueOnError` would turn the build partial. Co-authored-by: Copilot <[email protected]>
Bryan Chen (bryanchen-d)
added a commit
that referenced
this pull request
Oct 22, 2026
None of the 17 Cache@2 steps in the product build retried, so one transient pipeline-cache error failed the whole job even though every restore has a miss fallback. Over 90 days of main and release builds: - 8 builds failed on `Too Many Requests` (429) from the cache service, 2 of them in the post-job save - 487166 (official insider) lost Windows ARM64 Compile when the built-in extensions restore timed out after ~15 min of blob retries - 11 builds hit connection refused in a WSL cache restore that has since been removed (#342344) Add `retryCountOnTaskFailure: 2` to every Cache@2 step. A failure that survives both retries still fails the job: Cache@2 has no fail-open input, and `continueOnError` would turn the build partial. Co-authored-by: Copilot <[email protected]>
Ladislau Szomoru (lszomoru)
added a commit
that referenced
this pull request
Oct 23, 2026
All 18 WSL Dev Container prep failures since #342344 were apt-get inside the WSL distro stalling on archive.ubuntu.com and security.ubuntu.com, which ran past the 300 second command timeout. apt now uses the Azure Ubuntu mirror, as build-snap.sh and the sanity tests already do, and retries failed downloads. The rootfs and server downloads now abort transfers that are too slow to finish, since a transfer that ran into --max-time was already past --retry-max-time and was never retried. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ladislau Szomoru (lszomoru)
added a commit
that referenced
this pull request
Oct 28, 2026
* test: use the Azure Ubuntu mirror in the WSL smoke setup All 18 WSL Dev Container prep failures since #342344 were apt-get inside the WSL distro stalling on archive.ubuntu.com and security.ubuntu.com, which ran past the 300 second command timeout. apt now uses the Azure Ubuntu mirror, as build-snap.sh and the sanity tests already do, and retries failed downloads. The rootfs and server downloads now abort transfers that are too slow to finish, since a transfer that ran into --max-time was already past --retry-max-time and was never retried. Co-Authored-By: Claude Opus 5.5 <[email protected]> * test: retry WSL smoke downloads that run into --max-time curl only retries while --retry-max-time hasn't passed. It was 120 seconds, shorter than --max-time (180 seconds), so a download that was fast enough to pass the 1 MiB/s speed limit but too slow to finish in time (about 1.2-1.8 MiB/s for the 210-325 MiB downloads) ran until --max-time and was never retried. The retry window is now 300 seconds, so such a transfer is retried too. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Copilot <[email protected]>
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.
Wing K.Y (wingwkyuen)
pushed a commit
to tcgoidc/vscode
that referenced
this pull request
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Prepare WSL Dev Container smoke tests step in the Windows Electron smoke jobs was the top Windows flake last week. This PR fixes its cause: the Windows CI agents run an old inbox WSL with a 2021 WSL2 kernel. The PR installs a current, pinned WSL release instead, and puts a time limit on every
wsl.execall. A failed WSL setup still fails the job, as before. The same shared installer is also what the sanity tests need to run WSL tests again (#342405, stacked on #342227).Root cause
The 1ES
windows-2022images only have the inbox WSL. The setup diagnostics on a failed run show it:They have no WSL2 kernel.
wslDevContainer.ps1installed the standalonewsl_update_x64.msi, which provides kernel 5.10.16.3, built in April 2021. With it, the WSL2 utility VM sometimes:wsl --importuntil the 15-minute step timeout, after which evenwsl --listhangs in cleanup;-1, fixed only by retrying in test: retry transient WSL2 import failures in Windows smoke setup #338047);Earlier PRs fixed one symptom each: #337229 (download retries), #337644 (kernel installer cache), #338047 (import retries). The 325 MB rootfs download was never the problem: it finished in 3–4 s in every failed run. The "28 kB/s" figure people noticed was curl's first progress line.
The sanity tests have the same root cause (#342227). They never install a WSL2 kernel at all, so
wsl --import Ubuntufails with "WSL 2 requires an update to its kernel component", and everywsl-*sanity test has been skipped since late May.Failure counts (Oct 10–17)
There were 16 confirmed flakes: an attempt failed in this step, then a re-run of the same SHA passed. Four more failures had the same signatures but were never re-run.
wsl --importhangs until the step timeout. The rootfs had already downloaded in 3–4 s at 80–103 MB/s.apt-getSIGSEGV (5),apt-getstd::logic_errorabort (1), containerd SIGSEGV ×2 (1)Azure DevOps had one more: build 485030 shows the same import hang.
Baseline rate: in the latest 500
pr.ymlruns before this PR, 6 of 499 WSL setups failed (1.2%). #338047 measured about 4% in September.Failed attempts
wsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minwsl --importhung after rootfs download finished in 3–4s; step timed out at 15 min; cleanup then also timed out at 5 minapt-get installSIGSEGV (exit 139)apt-get installSIGSEGV (exit 139)apt-get installSIGSEGV (exit 139)apt-get installSIGSEGV (exit 139)apt-get installabort:std::logic_error(exit 134)apt-get installSIGSEGV (exit 139)Changes
1. Install a current, pinned WSL
build/azure-pipelines/common/wsl.psm1installs the release pinned inbuild/checksums/wsl.txt: WSL 3.0.3,wsl.3.0.3.0.x64.msifrommicrosoft/WSL.msiexec /qn /norestart, waits untilwsl --statusno longer reports "finishing an upgrade", and checks that the new version is active before setting WSL2 as the default.2. Time limits on all
wsl.execallsInvoke-WslExekillswsl.exeafter a timeout. A hung import now takes 2 minutes, then gets diagnostics,wsl --shutdown --force, and a retry on a fresh utility VM. Before, it ran into the 15-minute step timeout.3. Caching
build/checksums/wsl.txt.restore-wsl-installerrestores it.pr-node-modules.ymlfills the cache onmain, the same way it handles Electron, so PRs only read it.Cache@2with the same key.--retry-all-errors).4. No skipping. A failed WSL setup still fails the job. An earlier revision of this PR let PR CI skip the WSL suite when setup failed. That hid real regressions in the setup or the WSL path behind a green job, so it was removed. The prepare step keeps its 15-minute timeout: in the worst case, the bounded import retries need about 14 minutes.
Updating WSL: replace the line in
build/checksums/wsl.txt. This is documented in the smoke-tests skill.Validation
1es-vscode-oss-windows-2022-x64, each running the full prepare + cleanup (run 39137587992, 4 attempts; run 39143082726). The temporary workflow is removed again.Windows (shard 1/2) / Electron-Smoke, job 117705160723 (8573C) and job 117721316396 (8370C)Starts and reopens a Dev Container session over WSL(77.7 s, 71.6 s)1es-windows-2022-x64pool, through the sanity runs in #342405 (485751, 485752, 485757, 485758, 485759)Install-Wslinstalled 3.0.3 in about 20 s on each; Ubuntu imported as WSL21es-windows-2022-x64Prepare WSL Dev Container smoke tests -CI AzureDevOpstook 2m20s (WSL 3.0.3, kernel 6.18). The required WSL suite passed (Starts and reopens a Dev Container session over WSL, 63.8 s), 91 passing. Cleanup took 4 s, andCache@2saved the 367.6 MB installer. Its only failure was the build-script test below, now fixed.build/lib/test/testCheckpointTemplates.test.ts(node --test), which asserts the ADO WSL step namesagentHostTestSelection.test.ts8/8a222bd3), run 39147910162Compile & HygieneAbout the numbers: at the 1.2% baseline, 100 VMs would show about 1.2 failures on average, and 0 failures would still happen by chance about 30% of the time. So the probe shows the new setup works across many agents. On its own it doesn't prove a lower failure rate. The stronger argument is replacing a 2021 kernel with the supported current WSL, plus hangs now becoming 2-minute retries. The rate is worth tracking after merge with the
CPU:andWSL version:log lines.Not validated:
pr-node-modules.yml, which only runs onmain. Until then, PR runs download the 368 MB MSI from GitHub releases, which took a few seconds in the probe.