Skip to content

Commit 432d8d1

Browse files
stagg54claude
andcommitted
Poll for VIPM CLI readiness instead of trusting the installer's exit
Same install command, same env vars, two different outcomes across the last two CI runs: one got past the Settings.ini load and hit the (now-fixed) git error, the next regressed straight back to "Failed to load Settings.ini" - with no code change to explain the difference. That's consistent with the VIPM installer's main process exiting (satisfying Start-Process -Wait) before a detached background step finishes writing the default Settings.ini, i.e. a race, not a logic bug. Replaces "trust the installer returned, then locate vipm.exe" with an actual readiness check: after locating vipm.exe, poll `vipm --version` for up to 30s (15 attempts, 2s apart) before running any real command against it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent a85c532 commit 432d8d1

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

scripts/windows/run-caraya-tests.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,24 @@ function Find-Tool {
7171
Install-Vipm
7272
$vipm = Find-Tool -Name "vipm.exe"
7373

74+
# The installer's own process can exit (satisfying Start-Process -Wait) before VIPM has finished
75+
# writing its default Settings.ini in the background - seen directly in CI (against the LUnit job,
76+
# same image): the very same install sequence loaded Settings.ini fine on one run and failed with
77+
# "file not found" on another. Poll with a harmless command instead of assuming ready-to-use the
78+
# instant the installer returns.
79+
Write-Host "=== Waiting for VIPM CLI to become ready ==="
80+
$ready = $false
81+
for ($i = 1; $i -le 15; $i++) {
82+
& $vipm --version 2>&1 | Out-Null
83+
if ($LASTEXITCODE -eq 0) { $ready = $true; break }
84+
Write-Host "vipm not ready yet (attempt $i/15, exit $LASTEXITCODE) - waiting 2s"
85+
Start-Sleep -Seconds 2
86+
}
87+
if (-not $ready) {
88+
throw "vipm.exe never became ready after installing (still failing after 15 attempts)"
89+
}
90+
Write-Host "vipm is ready: $(& $vipm --version)"
91+
7492
function Invoke-Vipm {
7593
param([string[]]$VipmArgs)
7694
Write-Host "vipm $($VipmArgs -join ' ')"

scripts/windows/run-lunit-tests.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ function Find-Tool {
6565
Install-Vipm
6666
$vipm = Find-Tool -Name "vipm.exe"
6767

68+
# The installer's own process can exit (satisfying Start-Process -Wait) before VIPM has finished
69+
# writing its default Settings.ini in the background - seen directly in CI: the very same install
70+
# sequence loaded Settings.ini fine on one run and failed with "file not found" on another. Poll
71+
# with a harmless command instead of assuming ready-to-use the instant the installer returns.
72+
Write-Host "=== Waiting for VIPM CLI to become ready ==="
73+
$ready = $false
74+
for ($i = 1; $i -le 15; $i++) {
75+
& $vipm --version 2>&1 | Out-Null
76+
if ($LASTEXITCODE -eq 0) { $ready = $true; break }
77+
Write-Host "vipm not ready yet (attempt $i/15, exit $LASTEXITCODE) - waiting 2s"
78+
Start-Sleep -Seconds 2
79+
}
80+
if (-not $ready) {
81+
throw "vipm.exe never became ready after installing (still failing after 15 attempts)"
82+
}
83+
Write-Host "vipm is ready: $(& $vipm --version)"
84+
6885
function Invoke-Vipm {
6986
param([string[]]$VipmArgs)
7087
Write-Host "vipm $($VipmArgs -join ' ')"

0 commit comments

Comments
 (0)