Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single-process to flags #186

Merged
merged 8 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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