Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr-workspace-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ jobs:
# job. The cache key hashes the files that define the distribution, so that the shard of a commit that changes them
# builds the distribution instead; the shard restores the newest entry of its key.
wsl-distro:
name: Windows (WSL distribution)
name: Windows (WSL distro)
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: [ self-hosted, 1ES.Pool=1es-vscode-oss-windows-2022-x64, "JobId=wsl-distro-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}" ]
timeout-minutes: 30
Expand Down
9 changes: 6 additions & 3 deletions test/smoke/wslDevContainer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,12 @@ rm -rf /var/lib/apt/lists/*
sync
fstrim --verbose / || echo 'fstrim failed, so the export keeps the blocks of deleted files.'
'@
$terminate = Invoke-WslExe -ArgumentList '--terminate', $Distribution -TimeoutSeconds 60
if ($terminate.ExitCode -ne 0) {
throw "Failed to stop $Distribution before exporting it ($(Format-WslResult $terminate))."
# A VHD export fails with a sharing violation while the utility VM still holds the distribution's VHD, which
# --terminate doesn't release (https://github.com/microsoft/WSL/issues/10737). Prepare runs in a job of its own, so
# it stops the VM.
$shutdown = Invoke-WslExe -ArgumentList '--shutdown' -TimeoutSeconds 60
if ($shutdown.ExitCode -ne 0) {
throw "Failed to stop WSL before exporting $Distribution ($(Format-WslResult $shutdown))."
}
New-Item -ItemType Directory -Force -Path (Split-Path $Path -Parent) | Out-Null
Remove-Item -LiteralPath $Path -ErrorAction SilentlyContinue
Expand Down
Loading