Skip to content

Commit beb8cef

Browse files
committed
Limit sleep in windows ci
1 parent fde0ffa commit beb8cef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/scripts/uninstall-dotnet-windows.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ $extractPath = Join-Path $pwd "dotnet-core-uninstall" # needs to be a new path
99
msiexec.exe /A dotnet-core-uninstall.msi TARGETDIR=$extractPath /QN /L*V log.txt
1010
$uninstallToolPath = Join-Path $extractPath "dotnet-core-uninstall" "dotnet-core-uninstall.exe"
1111
# wait for the tool to be ready
12-
while (-not (Test-Path $uninstallToolPath)) {
12+
$maxRetries = 30
13+
$retry = 0
14+
while (-not (Test-Path $uninstallToolPath) -and ($retry -lt $maxRetries)) {
1315
Start-Sleep -Seconds 1
16+
$retry++
17+
}
18+
if ($retry -eq $maxRetries) {
19+
Write-Error "Uninstall tool was not found after $maxRetries seconds."
20+
exit 1
1421
}
1522

1623
# Perform uninstall

0 commit comments

Comments
 (0)