tractor/tests
Tyler Goodlet 60eca816e7 Be extra sure to re-raise EoCs from translator
That is whenever `trio.EndOfChannel` is raised (presumably from the
`._to_trio.receive()` call inside `LinkedTaskChannel.receive()`) we need
to be extra certain that we let it bubble upward transparently DESPITE
special exc-as-signal handling that is normally suppressed from the aio
side; REPEAT we want to ALWAYS bubble any `trio_err ==
trio.EndOfChannel` in the `finally:` handler of `translate_aio_errors()`
despite `chan._trio_to_raise == AsyncioTaskExited` such that the
caller's iterable machinery will operate as normal when the inter-task
stream is stopped (again, presumably by the aio side task terminating
the inter-task stream).

Main impl deats for this,
- in the EoC handler block ensure we assign both `chan._trio_err` and
  the local `trio_err` as well as continue to re-raise.
- add a case to the match block in the `finally:` handler which FOR SURE
  re-raises any `type(trio_err) is EndOfChannel`!

Additionally fix a bad bug,
- a ref bug where we were NOT using the
  `except BaseException as _trio_err` to assign to `chan._trio_err` (by
  accident was missing the leading `_`..)

Unrelated impl tweak,
- move all `maybe_raise_aio_side_err()` content back to inline with its
  parent func - makes it easier to use `tractor.pause()` mostly Bp
- go back to trying to use `aio_task.set_exception(aio_taskc)` for now
  even though i'm pretty sure we're going to move to a try-fute-first
  style helper for this in the future.

Adjust some tests to match/mk-them-green,
- break from `aio_echo_server()` recv loop on
  `to_asyncio.TrioTaskExited` much like how you'd expect to (implicitly
  with a `for`) with a `trio.EndOfChannel`.
- toss in a masked `value is None` pause point i needed for debugging
  inf looping caused by not re-raising EoCs per the main patch
  description.
- add a debug-mode sized delay to root-infected test.
2025-03-22 14:32:27 -04:00
..
devx Various test tweaks related to 3.13 egs 2025-03-22 14:29:54 -04:00
__init__.py Add `tests/__init__.py` for `.conftest` imports 2025-03-20 20:53:54 -04:00
conftest.py Add (masked) meta-debug-fixture for determining if `debug_mode` is set in harness.. 2025-03-22 14:29:54 -04:00
test_2way.py Move context-streaming operational tests into one mod 2021-12-06 16:45:44 -05:00
test_advanced_faults.py Another couple loose-ifies for discovery and advanced fault suites 2025-03-22 14:29:54 -04:00
test_advanced_streaming.py Various test tweaks related to 3.13 egs 2025-03-22 14:29:54 -04:00
test_cancellation.py Various test tweaks related to 3.13 egs 2025-03-22 14:29:54 -04:00
test_caps_based_msging.py Various test tweaks related to 3.13 egs 2025-03-22 14:29:54 -04:00
test_child_manages_service_nursery.py Various test tweaks related to 3.13 egs 2025-03-22 14:29:54 -04:00
test_clustering.py Add (back) a `tractor._testing` sub-pkg 2025-03-16 15:28:28 -04:00
test_context_stream_semantics.py Change `tractor.breakpoint()` to new `.pause()` in test suite 2025-03-22 14:24:53 -04:00
test_discovery.py Another couple loose-ifies for discovery and advanced fault suites 2025-03-22 14:29:54 -04:00
test_docs_examples.py Fix docs tests with yet another loosie-goosie 2025-03-22 14:32:26 -04:00
test_infected_asyncio.py Be extra sure to re-raise EoCs from translator 2025-03-22 14:32:27 -04:00
test_inter_peer_cancellation.py Another `is` fix.. 2025-03-22 14:29:54 -04:00
test_legacy_one_way_streaming.py Reapply "Port all tests to new `reg_addr` fixture name" 2025-03-20 19:50:31 -04:00
test_local.py Finally implement peer-lookup optimization.. 2025-03-21 15:25:55 -04:00
test_multi_program.py Finally implement peer-lookup optimization.. 2025-03-21 15:25:55 -04:00
test_pldrx_limiting.py Update `MsgTypeError` content matching to latest 2025-03-21 15:25:55 -04:00
test_pubsub.py Reapply "Port all tests to new `reg_addr` fixture name" 2025-03-20 19:50:31 -04:00
test_resource_cache.py Bump timeout on resource cache test a bitty bit. 2025-03-14 14:14:53 -04:00
test_root_infect_asyncio.py Be extra sure to re-raise EoCs from translator 2025-03-22 14:32:27 -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_spawning.py Update tests for `PldRx` and `Context` changes 2025-03-21 15:25:42 -04:00
test_task_broadcasting.py Use `collapse_eg()` in broadcaster suite 2025-03-22 14:32:27 -04:00
test_trioisms.py Another loosie in the trioisms suite 2025-03-22 14:32:27 -04:00