Repository navigation
test: use the Azure Ubuntu mirror in the WSL smoke setup - #343768
Merged
Merged
Conversation
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 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly scoped to download reliability, preserve existing failure handling, and have no identified correctness defects.
No open issues 🎉
What changed in this PR
This PR targets remaining download-related flakes in VS Code’s Windows WSL Dev Container smoke setup, following the WSL upgrade in #342344.
Changes:
- Switch Ubuntu apt sources to the Azure mirror and configure five download retries.
- Abort sustained low-speed curl transfers early to leave time for retries.
No actionable findings remain. Windows/WSL runtime validation still depends on CI.
| File | Description |
|---|---|
test/smoke/wslDevContainer.ps1 |
Updates apt mirror and retry settings, and adds curl low-speed limits. |
Review effort: Balanced
Christof Marti (chrmarti)
previously approved these changes
Oct 28, 2026
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 <223556219+Copilot@users.noreply.github.com>
Benjamin Christopher Simmonds (benibenj)
approved these changes
Oct 28, 2026
Ladislau Szomoru (lszomoru)
enabled auto-merge (squash)
October 28, 2026 09:28
Christof Marti (chrmarti)
approved these changes
Oct 28, 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 testsstep keeps failing and then passing on a re-run of the same commit, even after #342344. Since #343812, #343815 and #344338 it runs inWindows / Electron-Smoke (shard 1/3)on the 1ES pool (1es-vscode-oss-windows-2022-x64), and it still fails the same way there: on 2026-10-27 that job failed 5 times between 16:27 and 19:00 UTC; 2 runs were fixed by a manual re-run and 3 were left red.Cause
I went through the failed attempts of every re-run
Code OSSrun between 2026-10-09 and 2026-10-23 and grouped them by the error in the job log. There were 32 failed prep attempts:apt-getinside the WSL distro stalls onarchive.ubuntu.com/security.ubuntu.com: 17 hit the 300 sInvoke-Wsltimeout, 1 failedapt-get updatewithFile has unexpected size … Mirror sync in progress?wsl --importhung until the 15 minute step timeout. #342344 already fixed this.cloud-images.ubuntu.comtimed out (curl exit 28 after 180 s at ~700 kB/s), and curl's--retrynever ranThe 2026-10-27 failures on the 1ES pool are the first kind again. For example, in 40546831050 / job 122340803832 the 14.1 MB
jammy/universepackage index fromarchive.ubuntu.comtakes 2 min 31 s, the next indexes are just as slow, andapt-get updateis killed by the 300 s timeout; in 40565015771 / job 122404096673 the same index takes 3 min 50 s. In both, the rootfs and server downloads took 1–3 s.So nearly every flake left after #342344 comes from one thing: the step downloads ~130 MB of apt indexes and packages from Canonical's public archive. From the Azure-hosted agents that archive sometimes slows to a few hundred kB/s or stalls (healthy runs fetch the 80 MB of packages in about 1 s). Then
apt-get update+apt-get installruns past the 300 s budget for that command. apt was already retrying (theIgn:lines), but every retry went back to the same slow mirror.The rootfs download wasn't being retried because of a flag mismatch: curl only retries until
--retry-max-time(120 s) has passed, and that is shorter than--max-time(180 s), so by the time a slow transfer times out the retry window is already closed.Fix
In
test/smoke/wslDevContainer.ps1:azure.archive.ubuntu.com, the Azure-hosted Ubuntu mirror, and setAcquire::Retries "5"in/etc/apt/apt.conf.d/80-retries. This is whatbuild/azure-pipelines/linux/build-snap.shdoes (test/sanity/scripts/run-ubuntu.shalso switches to the mirror, without the retries). Unlike those scripts, this one also rewritessecurity.ubuntu.com, because both hosts stalled; the mirror servesjammy-securitytoo. The pinned jammy rootfs keeps its sources only in/etc/apt/sources.list(nosources.list.dentries, no deb822ubuntu.sources), and thesedrewrites all 10 entries there (7archive, 3security).Save-Download:--speed-limit 1048576 --speed-time 30). At that speed the 210 MiB server and 325 MiB rootfs downloads can't finish within--max-timeanyway, so the transfer is stopped after ~30 s and retried on a fresh connection.--retry-max-timefrom 120 to 300 s, above--max-time(180 s). Otherwise a transfer that is fast enough to pass the speed limit but too slow to finish (about 1.2–1.8 MiB/s) still runs into--max-timeafter the retry window has closed and is never retried. A single download now takes at most about 300 + 180 s, which leaves room for the ~2 minutes the rest of a healthy setup takes within the 15 minute step timeout.The same script runs in the Azure Pipelines Windows smoke job (
-CI AzureDevOpsinbuild/azure-pipelines/win32/steps/product-build-win32-test.yml, on1es-windows-2022-x64).-CIonly changes where the run ID, workspace and outputs come from, so that job gets the same fix. This PR's checks don't run it.How this relates to the other recent changes
vscode-large-runners-windows-8-core, ci: run more Windows smoke test shards and split the Windows remote tests #343815 split the Windows smoke tests into 3 shards, and Fix WSL smoke test runner to prevent hung PR checks #344338 keeps shard 1, which has the WSL suite, on the 1ES pool, because the larger runners intermittently freeze while WSL2 provisions a distribution. Those changes are about which machine runs the step. This PR changes where the step downloads from, so they don't overlap, and the 2026-10-27 failures show that the 1ES pool is affected too.test/smoke/wslDevContainer.ps1; the branch merges cleanly intomain.Cleanup step timeouts
All 3
Clean up WSL Dev Container smoke teststimeouts in the window (2026-10-13, 2026-10-16 ×2) came after a prep step that had hung under the old WSL. Before #342344, cleanup calledwsl.exewithout a timeout and hung on the same stuck utility VM. #342344 put every cleanup call behindInvoke-WslExetimeouts. Since then the only cleanup failures were in cancelled runs (the prep was cancelled mid-import andext4.vhdxwas still locked), so this PR leaves cleanup alone.Example runs
Failed attempts, each passing on re-run:
containerd(28 MB) fromarchive.ubuntu.comdoesn't finish within 3 minutes, so the 300 s timeout hitsapt-get updatetakes 3 min 5 s at 262 kB/s, then a package download times out (Ign:)runcapt-get updatestalls for 4.5 minutesapt-get updateexits 100 withMirror sync in progress?at 414 kB/sA healthy re-run for comparison: 39859083690 attempt 2 / job 120119525911, where
apt-get updatetakes 6 s and the packages come down at 106 MB/s.Validation
Locally (macOS, PowerShell 7.5.2, curl 8.7.1):
[System.Management.Automation.Language.Parser]::ParseFile('test/smoke/wslDevContainer.ps1', …): passed, 0 parse errors.etc/apt/from the pinned rootfs (ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz, 20250318) and ran the script'ssedon itssources.list: passed, 10 of 10 entries point atazure.archive.ubuntu.com, none left on another host./bin/bash -eucthroughProcessStartInfo.ArgumentList, the wayInvoke-WslExeruns them: passed, exit 0, and80-retriescontainsAcquire::Retries "5";.--retry-max-time<--max-time(1 request, exit 28) and was retried with--retry-max-time>--max-time; a transfer below the speed limit was aborted after--speed-timeand retried.In CI, this PR's own
Windows / Electron-Smoke (shard 1/3)(40662131812 / job 122728151515) ran the step on the 1ES pool and passed: all 63Get:lines are fromazure.archive.ubuntu.comand none fromarchive.ubuntu.comorsecurity.ubuntu.com;apt-get updatefetched 50.9 MB in 5 s and the 79.9 MB of packages in 4 s; the rootfs and server downloads took 3 s and 2 s; the whole prep took 2 min 0 s, andAgents Window (WSL Dev Container AgentHost)passed (18 passing, 0 failing). The first commit had already run the step twice on the 1ES pool with the same result (apt-get updatefetched 50.9 MB in 6 s): 39945462825 / job 120386997724 (prep 1 min 41 s) and 40658439457 / job 122715233630 (prep 2 min 0 s).🤖 Generated with Claude Code