Skip to content

[WSLC] Reset WSLC runtime between E2E tests to fix session-state bleed - #695

Draft
Soham Das (SohamDas2021) wants to merge 1 commit into
mainfrom
user/sodas/wslc-test-harness-wsl-reset
Draft

[WSLC] Reset WSLC runtime between E2E tests to fix session-state bleed#695
Soham Das (SohamDas2021) wants to merge 1 commit into
mainfrom
user/sodas/wslc-test-harness-wsl-reset

Conversation

@SohamDas2021

@SohamDas2021 Soham Das (SohamDas2021) commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

📖 Description

The WSLC E2E suite (tests/scripts/run_wslc_all_tests.ps1) flaked on volume-mount tests: running WSLC containers that mount host volumes back-to-back leaves the WSL runtime in a state where the next WslcCreateContainer returns E_INVALIDARG (0x80070057). Each config is individually correct, every affected test passes in isolation after a wsl --shutdown, but chained runs would intermittently fail (wslc_filesystem, wslc_readonly_mount, wslc_denied_masking, wslc_most_specific_denied_parent), depending on run order. This resets the runtime between tests.

🔗 References

🔍 Validation

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task

GitHub Actions runs the PR validation build automatically. The ADO pipeline
(MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity with the GitHub
Actions build; it runs on merge to main, and Microsoft reviewers with write access can trigger it
on a PR with /azp run. See docs/pull-requests.md.

If the dependency-feed-check check fails on a new dependency, the crate must be added to
the feed before the PR can pass. See docs/pull-requests.md
for the steps.

Microsoft Reviewers: Open in CodeFlow

Copilot AI review requested due to automatic review settings July 28, 2026 20:24
@SohamDas2021
Soham Das (SohamDas2021) requested a review from a team as a code owner July 28, 2026 20:24
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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.

Pull request overview

Adds WSLC runtime resets and targeted retries to prevent E2E session-state bleed.

Changes:

  • Shuts down WSL before each test attempt.
  • Retries transient 0x80070057 failures once.
  • Applies reset/retry handling to delegated fixture tests.

Comment on lines +105 to +113
$null = wsl --shutdown 2>&1
$deadline = (Get-Date).AddSeconds($TimeoutSeconds)
while ((Get-Date) -lt $deadline) {
$running = ""
try { $running = (& wsl.exe --list --running 2>$null | Out-String) -replace "`0", "" } catch { break }
if ([string]::IsNullOrWhiteSpace($running) -or $running -match 'no running') { break }
Start-Sleep -Milliseconds 500
}
Start-Sleep $SettleSeconds
@SohamDas2021
Soham Das (SohamDas2021) marked this pull request as draft July 28, 2026 20:28
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.

2 participants