tractor/tests
Gud Boi 50f40f427b Include `TransportClosed` in tpt-layer err handling
Add `TransportClosed` to except clauses where `trio`'s own
resource-closed errors are already caught, ensuring our
higher-level tpt exc is also tolerated in those same spots.
Likely i will follow up with a removal of the `trio` variants since most
*should be* caught and re-raised as tpt-closed out of the `.ipc` stack
now?

Add `TransportClosed` to various handler blocks,
- `._streaming.MsgStream.aclose()/.send()` except blocks.
- the broken-channel except in `._context.open_context_from_portal()`.
- obvi import it where necessary in those ^ mods.

Adjust `test_advanced_faults` suite + exs-script to match,
- update `ipc_failure_during_stream.py` example to catch
  `TransportClosed` alongside `trio.ClosedResourceError`
  in both the break and send-check paths.
- shield the `trio.sleep(0.01)` after tpt close in example to avoid
  taskc-raise/masking on that checkpoint since we want to simulate
  waiting for a user to send a KBI.
- loosen `ExceptionGroup` assertion to `len(excs) <= 2` and ensure all
  excs are `TransportClosed`.
- improve multi-line formatting, minor style/formatting fixes in
  condition expressions.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-02-19 13:55:02 -05:00
..
devx Improve tpt-closed msg-fmt/content and CRE case matching 2026-02-19 13:55:02 -05:00
ipc Don't hard code runtime-dir, read it with `._state.get_rt_dir()` 2025-08-18 21:30:48 -04:00
__init__.py Add `tests/__init__.py` for `.conftest` imports 2025-03-20 20:53:54 -04:00
conftest.py Drop `name=__name__` from all `get_logger()` calls 2026-02-11 21:04:49 -05:00
test_2way.py Move context-streaming operational tests into one mod 2021-12-06 16:45:44 -05:00
test_advanced_faults.py Include `TransportClosed` in tpt-layer err handling 2026-02-19 13:55:02 -05:00
test_advanced_streaming.py Remove lingering seg=False-flags from tests 2025-08-18 12:03:32 -04:00
test_cancellation.py Add timeout to inf-streamer test 2025-08-18 13:31:15 -04:00
test_child_manages_service_nursery.py Remove lingering seg=False-flags from tests 2025-08-18 12:03:32 -04:00
test_clustering.py Fix cluster suite, chng to new `gather_contexts()` 2025-08-18 10:46:37 -04:00
test_context_stream_semantics.py Move `.is_multi_cancelled()` to `.trioniics._beg` 2025-07-16 15:49:18 -04:00
test_discovery.py Remove lingering seg=False-flags from tests 2025-08-18 12:03:32 -04:00
test_docs_examples.py Ignore `examples/trio/` in docs-examples test suite 2025-09-06 13:39:08 -04:00
test_ext_types_msgspec.py Rename ext-types with `msgspec` suite module 2025-03-27 15:58:03 -04:00
test_infected_asyncio.py Change one infected-aio test to use `chan` in fn sig 2025-08-18 22:32:51 -04:00
test_inter_peer_cancellation.py Timeout on `test_peer_spawns_and_cancels_service_subactor` 2025-09-11 10:13:04 -04:00
test_legacy_one_way_streaming.py Styling tweaks to quadruple streaming test fn 2025-08-18 10:46:37 -04:00
test_local.py Finally switch to using address protocol in all runtime 2025-07-08 12:57:28 -04:00
test_log_sys.py Mk `test_implicit_mod_name_applied_for_child()` check init-mods 2026-02-11 21:43:37 -05:00
test_multi_program.py Catch-n-fail on stale `_root_addrs` state.. 2026-02-11 22:17:26 -05:00
test_oob_cancellation.py Woops, fix missing `assert` thanks to copilot 2025-09-11 13:13:18 -04:00
test_pldrx_limiting.py Update `MsgTypeError` content matching to latest 2025-03-24 14:04:52 -04:00
test_pubsub.py Reapply "Port all tests to new `reg_addr` fixture name" 2025-03-20 19:50:31 -04:00
test_remote_exc_relay.py Adjust ep-masking-suite for the real-use-case 2025-07-15 07:23:21 -04:00
test_resource_cache.py Drop `name=__name__` from all `get_logger()` calls 2026-02-11 21:04:49 -05:00
test_ringbuf.py Move concrete `Address`es to each tpt module 2025-07-08 18:05:05 -04:00
test_root_infect_asyncio.py Adjust `test_trio_prestarted_task_bubbles()` suite to expect non-eg raises 2025-08-18 10:46:37 -04:00
test_root_runtime.py Add a `debug_mode`-state reversion test 2025-07-14 00:00:12 -04:00
test_rpc.py Adjust all `RemoteActorError.type` using tests 2025-03-20 20:35:02 -04:00
test_runtime.py Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
test_shm.py Move tractor._shm to tractor.ipc._shm 2025-07-08 12:57:28 -04:00
test_spawning.py Move peer-tracking attrs from `Actor` -> `IPCServer` 2025-07-08 18:05:05 -04:00
test_task_broadcasting.py Use `collapse_eg()` in broadcaster suite 2025-03-27 13:38:47 -04:00
test_trioisms.py Tweaks from copilot, type fix, typos, language. 2025-09-11 10:01:25 -04:00