Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Reduce timeout

Magnus Müller9f711b42815e
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index c3b746a62..fa4a9399e 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -77,7 +77,7 @@ jobs:
tests:
needs: [setup-chromium, find_tests]
runs-on: ubuntu-latest
- timeout-minutes: 10 # Prevent individual tests from hanging
+ timeout-minutes: 4 # Reduced timeout - tests should complete quickly or retry
env:
IN_DOCKER: 'True'
ANONYMIZED_TELEMETRY: 'false'
@@ -145,24 +145,33 @@ jobs:
restore-keys: |
${{ runner.os }}-browseruse-extensions-
- - name: Check if test file exists and run it
+ - name: Check if test file exists
+ id: check-file
run: |
TEST_FILE="tests/ci/${{ matrix.test_filename }}.py"
if [ -f "$TEST_FILE" ]; then
- echo "✅ Running test file: $TEST_FILE"
- pytest "$TEST_FILE"
+ echo "exists=true" >> $GITHUB_OUTPUT
+ echo "✅ Test file found: $TEST_FILE"
else
+ echo "exists=false" >> $GITHUB_OUTPUT
echo "❌ Test file not found: $TEST_FILE"
echo "This file may have been renamed or removed. Current test files:"
ls -1 tests/ci/test_*.py | sed 's|tests/ci/||' | sed 's|\.py$||' | sort
- echo ""
- echo "Skipping this test job since the file no longer exists."
- exit 0 # Exit successfully to not fail the entire workflow
fi
+ - name: Run test with retry
+ if: steps.check-file.outputs.exists == 'true'
+ uses: nick-fields/retry@v3
+ with:
+ timeout_minutes: 2
+ max_attempts: 2
+ retry_on: error
+ command: pytest "tests/ci/${{ matrix.test_filename }}.py"
+
evaluate-tasks:
needs: setup-chromium
runs-on: ubuntu-latest
+ timeout-minutes: 4 # Allow more time for agent eval tasks
env:
IN_DOCKER: 'true'
BROWSER_USE_CLOUD_SYNC: 'false'
@@ -216,12 +225,17 @@ jobs:
- name: Run agent tasks evaluation and capture score
id: eval
- run: |
- python tests/ci/evaluate_tasks.py > result.txt
- cat result.txt
- echo "PASSED=$(grep '^PASSED=' result.txt | cut -d= -f2)" >> $GITHUB_ENV
- echo "TOTAL=$(grep '^TOTAL=' result.txt | cut -d= -f2)" >> $GITHUB_ENV
- echo "DETAILED_RESULTS=$(grep '^DETAILED_RESULTS=' result.txt | cut -d= -f2-)" >> $GITHUB_ENV
+ uses: nick-fields/retry@v3
+ with:
+ timeout_minutes: 4
+ max_attempts: 2
+ retry_on: error
+ command: |
+ python tests/ci/evaluate_tasks.py > result.txt
+ cat result.txt
+ echo "PASSED=$(grep '^PASSED=' result.txt | cut -d= -f2)" >> $GITHUB_ENV
+ echo "TOTAL=$(grep '^TOTAL=' result.txt | cut -d= -f2)" >> $GITHUB_ENV
+ echo "DETAILED_RESULTS=$(grep '^DETAILED_RESULTS=' result.txt | cut -d= -f2-)" >> $GITHUB_ENV
- name: Print agent evaluation summary
run: |