Repository navigation
test: let dockerd choose its bridge subnet in the WSL smoke distribution - #346615
Merged
Bryan Chen (bryanchen-d) merged 1 commit intoNov 6, 2026
Merged
Conversation
Contributor
|
Base:
|
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Pending Windows/WSL proof runs leave Docker’s non-overlapping subnet selection and Dev Container DNS/session startup unverified after VHD import.
No open issues 🎉
What changed in this PR
Updates the WSL smoke-test setup so imported prepared distributions can select a Docker bridge subnet that avoids the current machine’s WSL network, addressing intermittent container DNS failures.
Changes:
- Removes persisted Docker network state before starting dockerd, while preserving cached images.
- Logs the Docker bridge and WSL network subnets for diagnosis.
- Temporarily pins the Windows shard’s cache key to exercise the existing prepared-distribution import path; the PR description marks this proof-only change for removal before leaving draft.
| File | Description |
|---|---|
test/smoke/wslDevContainer.ps1 |
Resets Docker network state before startup and logs both network subnets. |
.github/workflows/pr-win32-test.yml |
Temporarily pins the prepared-distribution cache key for validation. |
Review effort: Balanced
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/wsl-prepared-docker-network
branch
from
November 6, 2026 19:59
34076c4 to
874ab08
Compare
dockerd stores the subnet of its default bridge under /var/lib/docker/network. The prepared WSL distribution (#346338) brings the subnet chosen on the machine that prepared it, 172.17.0.0/16, and when WSL puts this machine's NAT network inside it (172.17.16.0/20, 172.17.112.0/20), containers cannot reach the resolver: the dev container's postCreateCommand fails with 'Could not resolve host' and the WSL Dev Container smoke test times out. Remove the stored network before starting dockerd, so it picks a subnet that does not overlap this machine's routes, and log both subnets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/wsl-prepared-docker-network
branch
from
November 6, 2026 23:27
874ab08 to
4e7e2ae
Compare
Bryan Chen (bryanchen-d)
marked this pull request as ready for review
November 6, 2026 23:40
Bryan Chen (bryanchen-d)
enabled auto-merge (squash)
November 6, 2026 23:40
Dmitriy Vasyura (dmitrivMS)
approved these changes
Nov 6, 2026
Bryan Chen (bryanchen-d)
deleted the
copilot/vscode/wsl-prepared-docker-network
branch
November 6, 2026 23:53
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.
Fixes
WSL-PREPARED-DNS: since #346338 started importing a prepared WSL distribution,Windows / Electron-Smoke (shard 1/3)intermittently failsAgents Window (WSL Dev Container AgentHost) › Starts and reopens a Dev Container session over WSL. The dev container'spostCreateCommandgetscurl: (6) Could not resolve host: update.code.visualstudio.com. The latest hit was 17:51 UTC on Nov 6, on #346611.Cause: dockerd stores the subnet of its default bridge under
/var/lib/docker/networkand reuses it on every start. The prepared distribution carries the subnet that dockerd picked on the machine that prepared it,172.17.0.0/16. WSL picks its NAT network per machine, and in the failing runs it was inside that range: the host was172.17.16.1or172.17.112.1, while passing runs were on172.18,172.22,172.26and172.31. With overlapping subnets, containers route the resolver and the host intodocker0. When dockerd creates the bridge fresh, which is what the built path does, it skips subnets that overlap existing routes. That's why the built path never failed: 30 of 30 runs passed, against 5 of 26 failing on the prepared path.Fix:
Start-SmokeDockerremoves/var/lib/docker/networkbefore starting dockerd, so dockerd picks a non-overlapping subnet on every machine. Images, including the pre-pulled dev container image, are kept.docker.logthat the cleanup already uploads now also records the bridge subnet and the distribution's routes, so a future overlap is visible without guessing. Output streamed fromwsl.exedoesn't reach the job log, which is why this goes indocker.log.wslDevContainer.ps1changes the prepared-distribution cache key. After this merges, the shard builds the distribution until the next dailyPrepare, and that run uses this script too.Validation: a temporary commit, now dropped, pinned the cache key to main's current (faulty) prepared distribution. With it, 3 shard runs imported that distribution and passed the WSL Dev Container test (run 42266849943, attempts 2 to 4). The bridge network ID differs on every import (for example
a163e56a7d72and50785e90b6aa), which confirms the stored network was reset rather than reused. Those agents had WSL networks at172.24and172.28, so they didn't hit the overlap itself. The fix for the overlapping case rests on the mechanism above and on the built path, which already creates the bridge fresh and passed 30 of 30.lszomoru, this follows up on my comment on #346338. Close it if you'd rather fix it another way.