Always pre-sleep in `daemon` fixture when in non-linux CI..

ns_aware
Gud Boi 2026-03-02 15:27:01 -05:00
parent ab6c955949
commit 98a7d69341
1 changed files with 9 additions and 0 deletions

View File

@ -23,6 +23,7 @@ pytest_plugins: list[str] = [
'tractor._testing.pytest',
]
_non_linux: bool = platform.system() != 'Linux'
# Sending signal.SIGINT on subprocess fails on windows. Use CTRL_* alternatives
if platform.system() == 'Windows':
@ -150,6 +151,7 @@ def daemon(
testdir: pytest.Pytester,
reg_addr: tuple[str, int],
tpt_proto: str,
ci_env: bool,
) -> subprocess.Popen:
'''
@ -197,6 +199,13 @@ def daemon(
time.sleep(_PROC_SPAWN_WAIT)
assert not proc.returncode
# TODO! we should poll for the registry socket-bind to take place
# and only once that's done yield to the requester!
# -[ ] use the `._root.open_root_actor()`::`ping_tpt_socket()`
# closure!
if _non_linux and ci_env:
time.sleep(1)
yield proc
sig_prog(proc, _INT_SIGNAL)