mirror of
https://github.com/browser-use/browser-use
synced 2026-05-06 17:52:15 +02:00
stop playwright during browser teardown
This commit is contained in:
@@ -420,12 +420,12 @@ class BrowserSession(BaseModel):
|
||||
)
|
||||
|
||||
# Close playwright if we own it
|
||||
# if self.playwright:
|
||||
# try:
|
||||
# await self.playwright.stop()
|
||||
# self.playwright = None
|
||||
# except Exception as e:
|
||||
# self.logger.debug(f'Error stopping playwright: {type(e).__name__}: {e}')
|
||||
if self.playwright:
|
||||
try:
|
||||
await self.playwright.stop()
|
||||
self.playwright = None
|
||||
except Exception as e:
|
||||
self.logger.debug(f'Error stopping playwright: {type(e).__name__}: {e}')
|
||||
|
||||
self._reset_connection_state()
|
||||
|
||||
|
||||
@@ -161,7 +161,3 @@ async def test_actual_download_detection(test_server, tmp_path):
|
||||
assert duration < 2.0, f'Download detection took {duration:.2f}s, expected <2s'
|
||||
|
||||
await browser_session.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pytest.main([__file__, '-v', '-s'])
|
||||
|
||||
@@ -453,4 +453,4 @@ class TestTabManagement:
|
||||
assert browser_session.browser_context != original_context
|
||||
assert browser_session.initialized is True
|
||||
|
||||
await browser_session.stop()
|
||||
await browser_session.kill()
|
||||
|
||||
Reference in New Issue
Block a user