Skip to content

Commit dd5ab73

Browse files
committed
Add wait to after sneding browser.close()
1 parent 18b35c9 commit dd5ab73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

choreographer/browser_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@ async def _close(self) -> None:
179179
return
180180
except ChannelClosedError:
181181
_logger.debug("Can send browser.close on close channel")
182-
await asyncio.sleep(0.3)
183182
await asyncio.to_thread(self._channel.close)
183+
if await self._is_closed(wait=2):
184+
return
184185

185186
if await self._is_closed():
186187
_logger.debug("Browser is closed after closing channel")

0 commit comments

Comments
 (0)