From f0374e84d7b7bfe585d97043670980a7bdfa590a Mon Sep 17 00:00:00 2001 From: Vittorio Parrella Date: Sun, 25 Aug 2024 23:47:00 +0200 Subject: [PATCH] fix bad exit errorcode --- .github/workflows/run-performance.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-performance.yml b/.github/workflows/run-performance.yml index f737e67..3ffc125 100644 --- a/.github/workflows/run-performance.yml +++ b/.github/workflows/run-performance.yml @@ -183,17 +183,32 @@ jobs: run: | ${{ github.workspace }}/docker/speedtests/utils/windows-kill.exe -SIGINT @(Get-Process qpep | select -expand id) + - name: Wait Client Stop + if: always() + shell: pwsh + continue-on-error: true + run: | $Stoploop = $false + [ int ]$MaxRetries = "60" + do { try { - Get-Process qpep -ErrorAction Stop | select -expand id | out-null + $id = Get-Process qpep -ErrorAction Stop | select -expand id + Write-Host "QPep client still active with pid ${id}, wait 1sec..." + $Retrycount = $Retrycount - 1 Start-Sleep -Seconds 1 - Write-Host "QPep client still active, wait 1sec..." } catch { $Stoploop = $true Write-Host "QPep client stopped" } + + if ($Retrycount -lt 0){ + Write-Error "Could not get stop client after $MaxRetries retries, forcing stop." + $Stoploop = $true + + Get-Process qpep | Stop-Process + } } While($Stoploop -eq $false)