Skip to content

Commit d83e149

Browse files
committed
WSL machine tests: increase kernel boot timeout
This is to avoid CI/CD flakes and is based on this analysis of the WSL flakes logs: microsoft/WSL#13301 (comment) Signed-off-by: Mario Loriedo <[email protected]>
1 parent 80b20c7 commit d83e149

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

contrib/cirrus/win-podman-machine-test.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,25 @@ $Env:TEMP = 'Z:\'
4343
Write-Host "`nRunning podman-machine e2e tests"
4444

4545
if ($Env:TEST_FLAVOR -eq "machine-wsl") {
46+
if ($Env:CI -eq "true") {
47+
# Add a WSL configuration file
48+
# The `kernelBootTimeout` configuration is to prevent CI/CD flakes
49+
# See
50+
# https://github.com/microsoft/WSL/issues/13301#issuecomment-3367452109
51+
Write-Host "`nAdding WSL configuration file"
52+
$wslConfigPath = "$env:UserProfile\.wslconfig"
53+
$wslConfigContent = @"
54+
[wsl2]
55+
kernelBootTimeout=300000 # 5 minutes
56+
"@
57+
Set-Content -Path $wslConfigPath -Value $wslConfigContent -Encoding utf8
58+
wsl --shutdown
59+
Write-Host "`n$wslConfigPath content:"
60+
Get-Content -Path $wslConfigPath
61+
}
62+
4663
# Output info so we know what version we are testing.
64+
Write-Host "`nOutputting WSL version:"
4765
wsl --version
4866
Run-Command "$PSScriptRoot\win-collect-wsl-logs-start.ps1"
4967
}

0 commit comments

Comments
 (0)