tractor/examples
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
..
advanced_faults Include `TransportClosed` in tpt-layer err handling 2026-02-19 13:55:02 -05:00
debugging Add a root-already-cancelled crash handling test 2025-08-20 10:18:52 -04:00
integration Move pydantic-click hang example to new dir, skip in test suite 2022-08-02 12:16:58 -04:00
parallelism Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
trio Reduce "ignore cases" script to `trio`-only 2025-09-07 18:49:21 -04:00
__init__.py Make example a subpkg for `python -m <mod>` testing 2022-07-27 11:40:02 -04:00
__main__.py Use trio.run() in windows tests 2021-05-07 11:21:40 -04:00
a_trynamic_first_scene.py Drop `tractor.run()` from all examples 2021-05-07 11:21:40 -04:00
actor_spawning_and_causality.py Drop `tractor.run()` from all examples 2021-05-07 11:21:40 -04:00
actor_spawning_and_causality_with_daemon.py Drop lingering rpc_module_paths refs 2021-05-07 11:21:40 -04:00
asynchronous_generators.py Terminate async gen example caller to avoid (benign) errors in console output 2021-08-02 21:49:15 -04:00
full_fledged_streaming_service.py Various test tweaks related to 3.13 egs 2025-03-27 13:38:47 -04:00
infected_asyncio_echo_server.py Add context test that opens an inter-task-channel that errors 2022-07-14 16:13:12 -04:00
multiple_streams_one_portal.py Update all examples to new streaming API 2021-04-28 12:23:08 -04:00
quick_cluster.py Remove lingering seg=False-flags from examples 2025-08-18 12:03:10 -04:00
remote_error_propagation.py Drop lingering rpc_module_paths refs 2021-05-07 11:21:40 -04:00
rpc_bidir_streaming.py Drop now-deprecated deps on modern `trio`/Python 2025-03-16 16:06:24 -04:00
service_discovery.py Trying to make full suite pass with uds 2025-07-08 12:57:28 -04:00