Skip to content

Commit 5ad3678

Browse files
committed
fix(action): Reduce default wait timeout and improve logging
The default timeout for waiting for the test node to be ready has been reduced from 300 seconds to 90 seconds to improve action execution speed. The logging has also been improved to provide more detailed information about the connection attempts, including HTTP status codes and response bodies, making debugging easier. This change enhances the user experience by providing more informative feedback and reducing unnecessary wait times. The example workflow has also been updated to reflect the change in output variable name from `proxy-url` to `test-node-url` to better reflect the functionality. This ensures consistency and clarity in the provided example.
1 parent 73dbc41 commit 5ad3678

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

action.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inputs:
2424
wait-timeout:
2525
description: 'Timeout in seconds to wait for test node to be ready'
2626
required: false
27-
default: '300'
27+
default: '90'
2828

2929
registry:
3030
description: 'Container registry to use'
@@ -185,10 +185,22 @@ runs:
185185
186186
timeout ${{ inputs.wait-timeout }} bash -c '
187187
while true; do
188-
if curl -f http://localhost:${{ inputs.test-node-port }}/wd/hub/status 2>/dev/null; then
188+
echo "Testing endpoint: http://localhost:${{ inputs.test-node-port }}/wd/hub/status"
189+
response=$(curl -s -w "HTTP_CODE:%{http_code}" http://localhost:${{ inputs.test-node-port }}/wd/hub/status 2>/dev/null)
190+
http_code=$(echo "$response" | grep -o "HTTP_CODE:[0-9]*" | cut -d: -f2)
191+
response_body=$(echo "$response" | sed "s/HTTP_CODE:[0-9]*//")
192+
193+
if [ -n "$http_code" ]; then
194+
echo "Response: HTTP $http_code"
195+
if [ -n "$response_body" ]; then
196+
echo "Body: $response_body"
197+
fi
189198
echo "✅ DeviceLab test node is ready!"
190199
break
200+
else
201+
echo "❌ Connection failed - test node not responding yet"
191202
fi
203+
192204
echo "Still waiting... ($(( $(date +%s) - '"$start_time"' ))s elapsed)"
193205
sleep 5
194206
done
@@ -221,6 +233,7 @@ runs:
221233
echo "container-name=$CONTAINER_NAME" >> $GITHUB_OUTPUT
222234
echo "✅ DeviceLab test node is running at http://localhost:${{ inputs.test-node-port }}"
223235
236+
224237
branding:
225238
icon: 'smartphone'
226239
color: 'blue'

examples/basic-usage.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Start DeviceLab Appium
3636
id: devicelab
37-
uses: your-username/devicelab_appium@v1
37+
uses: izinga/devicelab_appium@v1
3838
with:
3939
devicelab-url: 'https://app.devicelab.dev/node/your-node-id'
4040
apk-artifact-name: 'app-release-apk'
@@ -51,10 +51,10 @@ jobs:
5151
5252
- name: Run Appium tests
5353
run: |
54-
echo "Running tests against: ${{ steps.devicelab.outputs.proxy-url }}"
55-
python -m pytest tests/ -v --appium-url="${{ steps.devicelab.outputs.proxy-url }}"
54+
echo "Running tests against: ${{ steps.devicelab.outputs.test-node-url }}"
55+
python -m pytest tests/ -v --appium-url="${{ steps.devicelab.outputs.test-node-url }}"
5656
57-
- name: Cleanup DeviceLab proxy
57+
- name: Cleanup DeviceLab test node
5858
if: always()
5959
run: |
6060
docker stop ${{ steps.devicelab.outputs.container-name }} || true

0 commit comments

Comments
 (0)