diff --git a/examples/debugging/sync_bp.py b/examples/debugging/sync_bp.py index 64a6e14b..8c4ba6e9 100644 --- a/examples/debugging/sync_bp.py +++ b/examples/debugging/sync_bp.py @@ -12,7 +12,7 @@ import tractor # disable `pbdp` prompt colors # for prompt matching in test. def disable_pdbp_color(): - if os.environ['PYTHON_COLORS'] == '0': + if os.environ.get('PYTHON_COLORS') == '0': from tractor.devx.debug import _repl _repl.TractorConfig.use_pygments = False diff --git a/tests/trionics/test_patches.py b/tests/trionics/test_patches.py index 9f2b942f..36bf1a59 100644 --- a/tests/trionics/test_patches.py +++ b/tests/trionics/test_patches.py @@ -59,7 +59,7 @@ def test_wakeup_socketpair_drain_eof_patch_works(): # First call MUST return True; idempotent guard # prevents False on subsequent calls within the # same process. - assert applied is True or applied is False # idempotent + assert isinstance(applied, bool) # idempotent (order-dependent value) # Cap wall-clock at 2s; SIGALRM raises in main # thread which interrupts the C-level recv loop diff --git a/tractor/devx/_stackscope.py b/tractor/devx/_stackscope.py index 35f22a49..e6ea00e5 100644 --- a/tractor/devx/_stackscope.py +++ b/tractor/devx/_stackscope.py @@ -71,17 +71,18 @@ def dump_task_tree( Do a classic `stackscope.extract()` task-tree dump to console at `.devx()` level. - Also unconditionally tee the rendered tree to two - capture-bypassing sinks so SIGUSR1 dumps remain visible - when the parent process has captured stdio (e.g. pytest's - default `--capture=fd`): + When `write_file`/`write_tty` are set, ALSO tee the rendered + tree to capture-bypassing sinks so SIGUSR1 dumps remain + visible when the parent process has captured stdio (e.g. + pytest's default `--capture=fd`); the SIGUSR1 handler passes + `write_file=True` for exactly this reason: - - `/tmp/tractor-stackscope-.log` (append-mode, always - written) — guaranteed-readable artifact even under CI + - `write_file` -> `/tmp/tractor-stackscope-.log` + (append-mode) — guaranteed-readable artifact even under CI / `nohup` / no-tty conditions. `tail -f` to follow. - - `/dev/tty` if a controlling terminal is attached — - best-effort, ignored if the device is missing or write - fails. pytest never captures the tty. + - `write_tty` -> `/dev/tty` if a controlling terminal is + attached — best-effort, ignored if the device is missing + or write fails. pytest never captures the tty. ''' import os diff --git a/tractor/ipc/_linux.py b/tractor/ipc/_linux.py index cd7de870..f7434ceb 100644 --- a/tractor/ipc/_linux.py +++ b/tractor/ipc/_linux.py @@ -24,7 +24,7 @@ import sys try: import cffi except ImportError as ie: - if sys.version_info < (3, 14): + if sys.version_info >= (3, 14): ie.add_note( f'The `cffi` pkg has no 3.14 support yet.\n' ) diff --git a/tractor/runtime/_portal.py b/tractor/runtime/_portal.py index e0577d69..738599ac 100644 --- a/tractor/runtime/_portal.py +++ b/tractor/runtime/_portal.py @@ -340,9 +340,9 @@ class Portal: raise_on_timeout ): raise ActorTooSlowError( - f'Peer {peer_id} did not ack `Actor.cancel()`' - f'-RPC within bounded wait of ' - f'{cancel_timeout!r}s' + f'Peer {peer_id} did not ack its ' + f'`Actor.cancel()` RPC within bounded wait ' + f'of {cancel_timeout!r}s' ) # legacy fire-and-forget path: log + return False so