Skip to content

Commit

Permalink
i am bold
Browse files Browse the repository at this point in the history
  • Loading branch information
chottuthejimmy committed Feb 13, 2025
1 parent 9618ab3 commit 03243b1
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/testdriver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
npm install
npm install dashcam-chrome
Start-Job -ScriptBlock {
echo "starting npm server"
npm start
echo "starting npm server"
npm start
}
echo "waiting for port to be live"
$portLive = $false
Expand All @@ -31,20 +31,11 @@ jobs:
while (-not $portLive) {
try {
$response = Invoke-WebRequest -Uri $targetUrl -Method Head -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop
if ($response.StatusCode -eq 200) {
if ($response.StatusCode -eq 200 -or $response.StatusCode -eq 404) {
$portLive = $true
Write-Output "Port is live (HTTP 200)"
}
}
catch {
# Check if the error response has a 404 status code
if ($_.Exception.Response.StatusCode.value__ -eq 404) {
$portLive = $true
Write-Output "Server responded with 404 - assuming valid response"
} else {
Start-Sleep -Seconds 1
}
}
}
Write-Output "Starting Chrome"
Expand Down

0 comments on commit 03243b1

Please sign in to comment.