Skip to content

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

attemp alternative approach where we creaet a dedicated loop for shudown

Nick Sweeting1c57d36211ee
diff --git a/tests/ci/test_agent_multiprocessing.py b/tests/ci/test_agent_multiprocessing.py
index b0b7e8264..342761ffc 100644
--- a/tests/ci/test_agent_multiprocessing.py
+++ b/tests/ci/test_agent_multiprocessing.py
@@ -39,15 +39,18 @@ def patched_del(self):
try:
# Check if the event loop is closed before calling the original
if hasattr(self, '_loop') and self._loop and self._loop.is_closed():
+ self._loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(self._loop)
# Event loop is closed, skip cleanup that requires the loop
- return
+ # return
original_del(self)
except RuntimeError as e:
- if 'Event loop is closed' in str(e):
- # Silently ignore this specific error
- pass
- else:
- raise
+ # if 'Event loop is closed' in str(e):
+ # # Silently ignore this specific error
+ # pass
+ # else:
+ # raise
+ raise
base_subprocess.BaseSubprocessTransport.__del__ = patched_del