Skip to content

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

tweak step timeouts

Nick Sweetingffba61d8f057
diff --git a/tests/ci/test_semaphores.py b/tests/ci/test_semaphores.py
index 81b01c483..749484e95 100644
--- a/tests/ci/test_semaphores.py
+++ b/tests/ci/test_semaphores.py
@@ -184,9 +184,9 @@ class TestMultiprocessSemaphore:
last_three = set(acquisition_order[3:])
assert last_three == {3, 4, 5}, f'Last 3 acquisitions should be workers 3, 4, 5, got {last_three}'
- # First 3 should acquire quickly (within 1.5s accounting for process startup and Python import overhead)
+ # First 3 should acquire quickly (within 2.5s accounting for process startup and Python import overhead)
for i in range(3):
- assert acquired_events[i][2] < 2, (
+ assert acquired_events[i][2] < 2.5, (
f'Worker {acquired_events[i][1]} should acquire quickly, took {acquired_events[i][2]:.2f}s'
)
diff --git a/tests/ci/test_sequential_agents_simple.py b/tests/ci/test_sequential_agents_simple.py
index 1b0ae1f6f..3dddf2711 100644
--- a/tests/ci/test_sequential_agents_simple.py
+++ b/tests/ci/test_sequential_agents_simple.py
@@ -147,26 +147,30 @@ class TestSequentialAgentsSimple:
assert agent1.browser_session.agent_current_page is not None
assert '/tab2' in agent1.browser_session.agent_current_page.url
- # Agent 2: Switch to first tab and take screenshot
+ # Clean up agent1
+ del agent1
+ gc.collect()
+ await asyncio.sleep(0.1)
+
+ # Agent 2: Switch to first tab
agent2_actions = [
- """{{
- "thinking": "Switching to first tab and taking screenshot",
+ """{
+ "thinking": "Switching to first tab",
"evaluation_previous_goal": "Two tabs are open",
"memory": "Need to switch to tab 0",
- "next_goal": "Switch to tab 0 and screenshot",
+ "next_goal": "Switch to tab 0",
"action": [
- {{"switch_tab": {{"page_id": 0}}}},
- {{"screenshot": {{}}}}
+ {"switch_tab": {"page_id": 0}}
]
- }}"""
+ }"""
]
agent2 = Agent(
- task='Switch to first tab and screenshot',
+ task='Switch to first tab',
llm=create_mock_llm(agent2_actions),
browser_session=browser_session,
)
- history2 = await agent2.run(max_steps=2)
+ history2 = await agent2.run(max_steps=3)
# Verify agent2 is on the first tab
assert agent2.browser_session is not None