Skip to content

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

increase screenshot timeout to default timeout

Nick Sweeting74d02c07a7d6
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 937e3a43f..88c624df1 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -89,7 +89,7 @@ jobs:
#- run: playwright install chrome # tests that need it can install it manually
- run: playwright install chromium
- - run: pytest --numprocesses auto --dist=loadscope -xsv tests/ci/${{ matrix.test_filename }}.py
+ - run: pytest --numprocesses auto tests/ci/${{ matrix.test_filename }}.py
evaluate-tasks:
runs-on: ubuntu-latest
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 37403cdb8..f7f05a2c5 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -2667,7 +2667,7 @@ class BrowserSession(BaseModel):
page.screenshot(
full_page=False, # never use full_page=True, it crashes the browser on any page larger than ~8000px-16000px depending on VRAM
scale='css',
- timeout=10000,
+ timeout=self.browser_profile.default_timeout or 30000,
clip={
'x': dimensions.get('scrollX', 0), # take screenshot from the current scroll position
'y': dimensions.get('scrollY', 0),
diff --git a/pyproject.toml b/pyproject.toml
index 03ce808d7..acc95e300 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -143,7 +143,7 @@ testpaths = [
"tests"
]
python_files = ["test_*.py", "*_test.py"]
-addopts = "-svx --strict-markers --tb=short --dist=loadscope --full-trace"
+addopts = "-svx --strict-markers --tb=short --dist=loadscope"
log_cli = true
log_cli_format = "%(levelname)-8s [%(name)s] %(message)s"
filterwarnings = [
diff --git a/tests/ci/test_browser_session_screenshots.py b/tests/ci/test_browser_session_screenshots.py
index 0e5ea5f3e..bba2def17 100644
--- a/tests/ci/test_browser_session_screenshots.py
+++ b/tests/ci/test_browser_session_screenshots.py
@@ -236,4 +236,6 @@ class TestHeadlessScreenshots:
finally:
# Kill all sessions in parallel
print('Killing all browser sessions...')
- await asyncio.gather(*[session.kill() for session in browser_sessions])
+ # Use return_exceptions=True to prevent one failed kill from affecting others
+ # This prevents "Future exception was never retrieved" errors
+ await asyncio.gather(*[session.kill() for session in browser_sessions], return_exceptions=True)