From d0cc06815f5f7db4b7a7cafeaaf9022e8ea05dcf Mon Sep 17 00:00:00 2001 From: goodboy Date: Fri, 14 Aug 2026 12:49:40 -0400 Subject: [PATCH] Accept raced `TransportClosed` diagnostics The `@context` debugger E2E intentionally closes its channel. Teardown can surface from either local error shipment or the peer receive task. The RPC response fix makes local close win under CI, while the test required both scheduler-dependent diagnostics. Keep the common debugger and cancellation assertions, then accept either transport-close report. This preserves real actor-tree teardown coverage without depending on task scheduling order. Review: PR #480 (goodboy) https://github.com/goodboy/tractor/pull/480 (this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`)) --- tests/devx/test_debugger.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tests/devx/test_debugger.py b/tests/devx/test_debugger.py index dfcf36d8..5830cf94 100644 --- a/tests/devx/test_debugger.py +++ b/tests/devx/test_debugger.py @@ -1307,18 +1307,30 @@ def test_ctxep_pauses_n_maybe_ipc_breaks( if _non_linux: tpt: str = 'TCP' - assert_before( + before: str = assert_before( child, ['peer IPC channel closed abruptly?', 'another task closed this fd', 'Debug lock request was CANCELLED?', - f"'Msgpack{tpt}Stream' was already closed locally?", - f"TransportClosed: 'Msgpack{tpt}Stream' was already closed 'by peer'?", - ] + ] - # XXX races on whether these show/hit? - # 'Failed to REPl via `_pause()` You called `tractor.pause()` from an already cancelled scope!', - # 'AssertionError', + # XXX races on whether these show/hit? + # 'Failed to REPl via `_pause()` You called `tractor.pause()` from an already cancelled scope!', + # 'AssertionError', + ) + + # Error shipment and peer receive race after local close. + # Either diagnostic proves the transport was torn down. + closed_locally: str = ( + f"'Msgpack{tpt}Stream' was already closed locally?" + ) + closed_by_peer: str = ( + f"TransportClosed: 'Msgpack{tpt}Stream' was " + f"already closed 'by peer'?" + ) + assert ( + closed_locally in before + or closed_by_peer in before ) # OSc(ancel) the hanging tree do_ctlc(