Skip to content

test: add WSL import failure diagnostics - #337242

Merged
Christof Marti (chrmarti) merged 1 commit into
mainfrom
test-wsl-import-diagnostics
Sep 22, 2026
Merged

Christof Marti (chrmarti) merged 1 commit into
mainfrom
test-wsl-import-diagnostics

Conversation

@chrmarti

Copy link
Copy Markdown
Collaborator

Summary

  • capture WSL status and registered distributions after a failed WSL2 import
  • report virtualization, optional-feature, service, and pending-reboot state
  • include up to 10 recent events from the relevant WSL and Hyper-V channels
  • preserve the original wsl --import exit code even when individual diagnostics fail

This adds actionable failure output for cases such as the Windows Electron-Smoke failure on #337233, where wsl --import --version 2 returned exit code -1 with The interface is unknown on one hosted VM while an identical concurrent runner succeeded.

Diagnostic sections are failure-only and independently guarded. Missing event channels, unavailable services, or insufficient permissions produce warnings instead of replacing the original import error. Event output is limited to 10 entries per channel from the previous 10 minutes.

Validation

  • parsed test/smoke/wslDevContainer.ps1 with the PowerShell parser
  • exercised the diagnostic functions independently on Windows
  • verified unavailable/elevation-limited probes degrade to warnings
  • ran git diff --check

A full WSL smoke setup was not run locally because it modifies host WSL distributions and firewall state and downloads the CI test assets.

Capture WSL, virtualization, service, reboot, and recent event state without masking the original import exit code.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 22, 2026 09:34

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.

Copilot review overview

🟢 Approval recommended

The diagnostic probes are bounded, independently guarded, and preserve the original failure context.

Review effort: Balanced
Findings: None

What changed in this PR

Adds failure-only diagnostics to Windows WSL smoke-test provisioning.

Changes:

  • Reports WSL, virtualization, feature, service, reboot, and recent event state.
  • Preserves the original import exit code when diagnostics fail.
File Description
test/​smoke/​wslDevContainer.ps1 Collects guarded diagnostics after failed WSL2 imports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@chrmarti
Christof Marti (chrmarti) merged commit 8bc9f99 into main Sep 22, 2026
34 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the test-wsl-import-diagnostics branch September 22, 2026 13:21
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 22, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants