Skip to content

Commit 1d37264

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 1d37264

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ $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 https://github.com/microsoft/WSL/issues/13301#issuecomment-3367452109
50+
$wslConfigPath = "$env:UserProfile\.wslconfig"
51+
$wslConfigContent = @"
52+
[wsl2]
53+
kernelBootTimeout=300000 # 5 minutes
54+
"@
55+
Set-Content -Path $wslConfigPath -Value $wslConfigContent -Encoding utf8
56+
& wsl --shutdown
57+
}
58+
4659
# Output info so we know what version we are testing.
4760
wsl --version
4861
Run-Command "$PSScriptRoot\win-collect-wsl-logs-start.ps1"

0 commit comments

Comments
 (0)