tractor/tests
Tyler Goodlet b13cd4f16b Extend ctx semantics suite for streaming edge cases!
Muchas grax to @guilledk for finding the first issue which kicked of
this further scrutiny of the `tractor.Context` and `MsgStream` semantics
test suite with a strange edge case where,
- if the parent opened and immediately closed a stream while the remote
  child task started and continued (without terminating) to send msgs
  the parent's `open_context().__aexit__()` would **not block** on the
  child to complete!
=> this was seemingly due to a bug discovered inside the
  `.msg._ops.drain_to_final_msg()` stream handling case logic where we
  are NOT checking if `Context._stream` is non-`None`!

As such this,
- extends the `test_caller_closes_ctx_after_callee_opens_stream` (now
  renamed, see below) to include cases for all combinations of the child
  and parent sending before receiving on the stream as well as all
  placements of `Context.cancel()` in the parent before, around and after
  the stream open.
- uses the new `expect_ctxc()` for expecting the taskc (`trio.Task`
  cancelled)` cases.
- also extends the `test_callee_closes_ctx_after_stream_open` (also
  renamed) to include the case where the parent sends a msg before it
  receives.
=> this case has unveiled yet-another-bug where somehow the underlying
  `MsgStream._rx_chan: trio.ReceiveMemoryChannel` is allowing the
  child's `Return[None]` msg be consumed and NOT in a place where it is
  correctly set as `Context._result` resulting in the parent hanging
  forever inside `._ops.drain_to_final_msg()`..

Alongside,
- start renaming using the new "remote-task-peer-side" semantics
  throughout the test module: "caller" -> "parent", "callee" -> "child".
2025-03-24 21:45:15 -04:00
..
devx Various test tweaks related to 3.13 egs 2025-03-24 21:44:59 -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-24 21:44:59 -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-24 21:44:59 -04:00
test_advanced_streaming.py Various test tweaks related to 3.13 egs 2025-03-24 21:44:59 -04:00
test_cancellation.py Various test tweaks related to 3.13 egs 2025-03-24 21:44:59 -04:00
test_caps_based_msging.py Facepalm, fix logic misstep on child side 2025-03-24 21:45:15 -04:00
test_child_manages_service_nursery.py Various test tweaks related to 3.13 egs 2025-03-24 21:44:59 -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 Extend ctx semantics suite for streaming edge cases! 2025-03-24 21:45:15 -04:00
test_discovery.py Another couple loose-ifies for discovery and advanced fault suites 2025-03-24 21:44:59 -04:00
test_docs_examples.py Fix docs tests with yet another loosie-goosie 2025-03-24 21:44:59 -04:00
test_infected_asyncio.py Be extra sure to re-raise EoCs from translator 2025-03-24 15:37:12 -04:00
test_inter_peer_cancellation.py Another `is` fix.. 2025-03-24 15:37:12 -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-24 14:04:52 -04:00
test_multi_program.py Finally implement peer-lookup optimization.. 2025-03-24 14:04:52 -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_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-24 15:37: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_spawning.py Update tests for `PldRx` and `Context` changes 2025-03-24 14:04:51 -04:00
test_task_broadcasting.py Use `collapse_eg()` in broadcaster suite 2025-03-24 21:44:59 -04:00
test_trioisms.py Another loosie in the trioisms suite 2025-03-24 21:44:59 -04:00