Skip to content

Commit

Permalink
Merge pull request #186 from plotly/andrew/flags
Browse files Browse the repository at this point in the history
Add single-process to flags
  • Loading branch information
ayjayt authored Jan 29, 2025
2 parents d71b5a2 + dd5ab73 commit 25f7891
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion choreographer/browser_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ async def _close(self) -> None:
return
except ChannelClosedError:
_logger.debug("Can send browser.close on close channel")

await asyncio.to_thread(self._channel.close)
if await self._is_closed(wait=2):
return

if await self._is_closed():
_logger.debug("Browser is closed after closing channel")
Expand Down
6 changes: 6 additions & 0 deletions choreographer/utils/_kill.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import platform
import subprocess

import logistro

_logger = logistro.getLogger(__name__)


def kill(process: subprocess.Popen[bytes]) -> None:
if platform.system() == "Windows":
Expand All @@ -13,5 +17,7 @@ def kill(process: subprocess.Popen[bytes]) -> None:
)
else:
process.terminate()
_logger.info("Called terminate")
if process.poll() is None:
_logger.info("Calling kill")
process.kill()
2 changes: 1 addition & 1 deletion choreographer/utils/_tmpfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def extra_clean() -> None:
_logger.info(f"Extra manual clean executing {i}.")
self._delete_manually(quiet=True)
i += 1
time.sleep(2)
time.sleep(10)
if self.path.exists():
self._delete_manually(quiet=False)

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async def wrapped_test_fn(*args, **kwargs):

def pytest_configure():
# change this by command line TODO
pytest.default_timeout = 20
pytest.default_timeout = 60


# pytest shuts down its capture before logging/threads finish
Expand Down

0 comments on commit 25f7891

Please sign in to comment.