Skip to content

Commit

Permalink
Wait for test proxy startup (Azure#28088)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
azure-sdk and benbp authored Apr 7, 2022
1 parent ada9824 commit 74c325e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion eng/common/testproxy/test-proxy-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
- pwsh: |
$version = $(Get-Content "$(Build.SourcesDirectory)/eng/common/testproxy/target_version.txt" -Raw).Trim()
$overrideVersion = "${{ parameters.targetVersion }}"
if($overrideVersion) {
Write-Host "Overriding default target proxy version of '$version' with override $overrideVersion."
$version = $overrideVersion
Expand Down Expand Up @@ -47,3 +47,18 @@ steps:
displayName: "Run the testproxy - linux/mac"
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'))
workingDirectory: "${{ parameters.rootFolder }}"
- pwsh: |
for ($i = 0; $i -lt 10; $i++) {
try {
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
exit 0
} catch {
Write-Warning "Failed to successfully connect to test proxy. Retrying..."
Start-Sleep 6
}
}
Write-Error "Could not connect to test proxy."
exit 1
displayName: Test Proxy IsAlive

0 comments on commit 74c325e

Please sign in to comment.