From c4885f9d9986c27d0853e7e3ccabe205daeed41c Mon Sep 17 00:00:00 2001 From: goodboy Date: Mon, 4 May 2026 16:23:50 -0400 Subject: [PATCH] Drop global mutation of `_PROC_SPAWN_WAIT` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In top level `daemon`-fixture that is.. Use a local `bg_daemon_spawn_delay` instead of mutating the module-level `_PROC_SPAWN_WAIT` — previously each `daemon` fixture invocation would permanently add 1.6s (UDS) or 1s (CI) to the global, inflating delays across the session. Also, emit a `test_log.warning()` when verbose loglevel is silently reduced to `'info'`. (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- tests/conftest.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9e0a1710..7e246db2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -254,6 +254,7 @@ def daemon( tpt_proto: str, ci_env: bool, test_log: tractor.log.StackLevelAdapter, + # set_fork_aware_capture, ) -> subprocess.Popen: ''' @@ -261,8 +262,12 @@ def daemon( "remote registrar" for discovery-protocol related tests. ''' + # XXX: too much logging will lock up the subproc (smh) if loglevel in ('trace', 'debug'): - # XXX: too much logging will lock up the subproc (smh) + test_log.warning( + f'Test harness log level is too verbose: {loglevel!r}\n' + f'Reducing to INFO level..' + ) loglevel: str = 'info' code: str = ( @@ -300,19 +305,19 @@ def daemon( # -[ ] UDS: can we do something similar for 'pinging" the # file-socket? # - global _PROC_SPAWN_WAIT + bg_daemon_spawn_delay: float = _PROC_SPAWN_WAIT # UDS sockets are **really** fast to bind()/listen()/connect() # so it's often required that we delay a bit more starting # the first actor-tree.. if tpt_proto == 'uds': - _PROC_SPAWN_WAIT += 1.6 + bg_daemon_spawn_delay += 1.6 if _non_linux and ci_env: - _PROC_SPAWN_WAIT += 1 + bg_daemon_spawn_delay += 1 # XXX, allow time for the sub-py-proc to boot up. # !TODO, see ping-polling ideas above! - time.sleep(_PROC_SPAWN_WAIT) + time.sleep(bg_daemon_spawn_delay) assert not proc.returncode yield proc