Skip to content

Commit bd33762

Browse files
azure-sdkbenbp
andauthored
Wait for test proxy startup (Azure#23889)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 82fcc5a commit bd33762

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

eng/common/testproxy/test-proxy-tool.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ steps:
1111
- pwsh: |
1212
$version = $(Get-Content "$(Build.SourcesDirectory)/eng/common/testproxy/target_version.txt" -Raw).Trim()
1313
$overrideVersion = "${{ parameters.targetVersion }}"
14-
14+
1515
if($overrideVersion) {
1616
Write-Host "Overriding default target proxy version of '$version' with override $overrideVersion."
1717
$version = $overrideVersion
@@ -47,3 +47,18 @@ steps:
4747
displayName: "Run the testproxy - linux/mac"
4848
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'))
4949
workingDirectory: "${{ parameters.rootFolder }}"
50+
51+
- pwsh: |
52+
for ($i = 0; $i -lt 10; $i++) {
53+
try {
54+
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
55+
exit 0
56+
} catch {
57+
Write-Warning "Failed to successfully connect to test proxy. Retrying..."
58+
Start-Sleep 6
59+
}
60+
}
61+
Write-Error "Could not connect to test proxy."
62+
exit 1
63+
displayName: Test Proxy IsAlive
64+

0 commit comments

Comments
 (0)