From 5f100ec49410188fbb2e745263aa38a44908291c Mon Sep 17 00:00:00 2001 From: daxpedda Date: Tue, 10 Dec 2024 23:59:56 +0100 Subject: [PATCH] Testing --- .github/workflows/test.yaml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 03cb46f..38a42c2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -133,8 +133,34 @@ jobs: - name: Start and set WebDriver if: matrix.driver.browser == true run: | - ${{ matrix.driver.binary }} --port=9000 & - echo "${{ matrix.driver.env }}_REMOTE=http://127.0.0.1:9000" >> $GITHUB_ENV + iteration=5 + + until (( iteration == 0 )); do + (( iteration-- )) + + ${{ matrix.driver.binary }} --port=9000 2>stderr & + process_pid=$! + + sleep 1 + + if [[ $(wc -l < stderr) -gt 0 ]]; then + echo "CI: WebDriver failed" + kill -SIGKILL $process_pid || true + echo + + echo "CI: stderr:" + sed 's/^/CI: /' stderr + echo + + echo "CI: Re-trying to start the WebDriver." + else + echo "${{ matrix.driver.env }}_REMOTE=http://127.0.0.1:9000" >> $GITHUB_ENV + exit 0 + fi + done + + echo "CI: Failed to start driver." + exit 1 - name: Set environment if: matrix.environment.name != '' run: echo "${{ matrix.environment.name }}=1" >> $GITHUB_ENV