Skip to content

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

fix: resolve test configuration and security issues

claude[bot]a3b3281564ba
diff --git a/tests/ci/test_live_oauth2_integration.py b/tests/ci/test_live_oauth2_integration.py
index 6ccd57e82..058e67880 100644
--- a/tests/ci/test_live_oauth2_integration.py
+++ b/tests/ci/test_live_oauth2_integration.py
@@ -135,7 +135,7 @@ async def test_live_oauth2_integration(temp_browser_profile):
logger.info(f'📊 Agent session ID: {cloud_sync.session_id}')
logger.info(f'🌐 Check session at: {backend_url}/agent/{cloud_sync.session_id}')
- await asyncio.sleep(60000)
+ # Test completed - removed excessive sleep
@pytest.mark.skipif(not os.getenv('RUN_LIVE_TESTS'), reason='Live integration tests only run when RUN_LIVE_TESTS=1 is set')
@@ -187,7 +187,7 @@ async def test_live_cloud_sync_events():
if cloud_sync.session_id:
logger.info(f'📊 Session ID: {cloud_sync.session_id}')
- await asyncio.sleep(60000)
+ # Test completed - removed excessive sleep
if __name__ == '__main__':
diff --git a/tests/ci/test_oauth2_cloud_sync.py b/tests/ci/test_oauth2_cloud_sync.py
index aceba68bd..196d027a9 100644
--- a/tests/ci/test_oauth2_cloud_sync.py
+++ b/tests/ci/test_oauth2_cloud_sync.py
@@ -52,13 +52,11 @@ def temp_config_dir():
import browser_use.sync.auth
import browser_use.utils
- browser_use.sync.auth.BROWSER_USE_CONFIG_DIR = temp_dir
browser_use.utils.BROWSER_USE_CONFIG_DIR = temp_dir
yield temp_dir
# Restore original
- browser_use.sync.auth.BROWSER_USE_CONFIG_DIR = original
browser_use.utils.BROWSER_USE_CONFIG_DIR = original
@@ -523,7 +521,8 @@ class TestCloudSyncService:
)
# Mock WAL file
- wal_path = Path(tempfile.mktemp(suffix='.jsonl'))
+ with tempfile.NamedTemporaryFile(suffix='.jsonl', delete=False) as temp_file:
+ wal_path = Path(temp_file.name)
# Write test events
events = [