From d7ac9ee4a444040e9d7cff33c6eae282a938d966 Mon Sep 17 00:00:00 2001 From: goodboy Date: Tue, 9 Jun 2026 23:33:16 -0400 Subject: [PATCH] Restore spawner-aware `ctlc` skip + richer skip-msg Bring back two `tests/devx/conftest.py` refinements whose carrying commit was otherwise superseded during the sub-branch factoring: - `ctlc` fixture takes `start_method` and documents the per-spawner fragility of ctl-c-in-REPL scenarios via a docstring + an (empty for now) allow-set for the `has_nested_actors` skip. - `spawn` fixture's unsupported-backend skip msg now reports the requested backend + the supported set. (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- tests/devx/conftest.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/devx/conftest.py b/tests/devx/conftest.py index 3be1cfe2..e64d38dc 100644 --- a/tests/devx/conftest.py +++ b/tests/devx/conftest.py @@ -79,7 +79,8 @@ def spawn( } if start_method not in supported_spawners: pytest.skip( - '`pexpect` based tests only supported on `trio` backend' + f'`pexpect` based tests NOT supported on spawning-backend: {start_method!r}\n' + f'supported-spawners: {supported_spawners!r}' ) def unset_colors(): @@ -211,21 +212,38 @@ def spawn( def ctlc( request: pytest.FixtureRequest, ci_env: bool, - + start_method: str, ) -> bool: + ''' + Parametrize and optionally skip tests which handle + ctlc-in-`pdbp`-REPL testing scenarios; certain spawners and actor-tree depths + cope very poorly with this.. + In particular the spawning backends from `multiprocessing` are + fragile, as can be the default `trio` spawner under certain + conditions where SIGINT is relayed down the entire subproc tree. + + ''' use_ctlc: bool = request.param node = request.node markers = node.own_markers for mark in markers: - if mark.name == 'has_nested_actors': + if ( + mark.name == 'has_nested_actors' + and + start_method not in { + # TODO, any spawners we should try again? + # - [ ] 'trio' but WITHOUT the SIGINT handler setup + # per subproc? + # 'main_thread_forkserver', + } + ): pytest.skip( f'Test {node} has nested actors and fails with Ctrl-C.\n' f'The test can sometimes run fine locally but until' ' we solve' 'this issue this CI test will be xfail:\n' 'https://github.com/goodboy/tractor/issues/320' ) - if ( mark.name == 'ctlcs_bish' and