Skip to content

Commit 5f100ec

Browse files
committed
Testing
1 parent 514fc38 commit 5f100ec

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/test.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,34 @@ jobs:
133133
- name: Start and set WebDriver
134134
if: matrix.driver.browser == true
135135
run: |
136-
${{ matrix.driver.binary }} --port=9000 &
137-
echo "${{ matrix.driver.env }}_REMOTE=http://127.0.0.1:9000" >> $GITHUB_ENV
136+
iteration=5
137+
138+
until (( iteration == 0 )); do
139+
(( iteration-- ))
140+
141+
${{ matrix.driver.binary }} --port=9000 2>stderr &
142+
process_pid=$!
143+
144+
sleep 1
145+
146+
if [[ $(wc -l < stderr) -gt 0 ]]; then
147+
echo "CI: WebDriver failed"
148+
kill -SIGKILL $process_pid || true
149+
echo
150+
151+
echo "CI: stderr:"
152+
sed 's/^/CI: /' stderr
153+
echo
154+
155+
echo "CI: Re-trying to start the WebDriver."
156+
else
157+
echo "${{ matrix.driver.env }}_REMOTE=http://127.0.0.1:9000" >> $GITHUB_ENV
158+
exit 0
159+
fi
160+
done
161+
162+
echo "CI: Failed to start driver."
163+
exit 1
138164
- name: Set environment
139165
if: matrix.environment.name != ''
140166
run: echo "${{ matrix.environment.name }}=1" >> $GITHUB_ENV

0 commit comments

Comments
 (0)