Skip to content

Commit

Permalink
Attempt meteor --get-ready three times in AppVeyor tests (meteor#9518)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmillerburgess authored and benjamn committed Jan 10, 2018
1 parent b3470fd commit 616bab6
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions scripts/windows/appveyor/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,26 @@ If ($LASTEXITCODE -ne 0) {
throw "Updating submodules failed."
}

Write-Host "Running 'meteor --get-ready'..." -ForegroundColor Magenta
# By redirecting error to host, we avoid a shocking/false error color,
# since --get-ready and --version can print (anything) to STDERR and
# PowerShell will interpret that as something being terribly wrong.
& "$meteorBat" --get-ready 2>&1 | Write-Host -ForegroundColor Green
# The `meteor --get-ready` command is susceptible to EPERM errors, so
# we attempt it three times.
$attempt = 3
$success = $false
while ($attempt -gt 0 -and -not $success) {

Write-Host "Running 'meteor --get-ready'..." -ForegroundColor Magenta
# By redirecting error to host, we avoid a shocking/false error color,
# since --get-ready and --version can print (anything) to STDERR and
# PowerShell will interpret that as something being terribly wrong.
& "$meteorBat" --get-ready 2>&1 | Write-Host -ForegroundColor Green

If ($LASTEXITCODE -eq 0) {
$success = $true
} else {
$attempt--
}

}

If ($LASTEXITCODE -ne 0) {
throw "Running .\meteor --get-ready failed."
throw "Running .\meteor --get-ready failed three times."
}

0 comments on commit 616bab6

Please sign in to comment.