tractor/tests
Tyler Goodlet 9c6b90ef04 Add a ignore-masking-case script + suite
Demonstrating the guilty `trio.Lock.acquire()` impl which puts
a checkpoint inside its `trio.WouldBlock` handler and which will always
appear to mask the "sync path" case on (graceful) cancellation.

This first script draft demos the issue from within a `tractor.context`
ep bc that's where it was orig discovered, however i'm going to factor
out the `tractor` code and instead just use
a `.trionics.maybe_raise_from_masking_exc()` to demo its low-level
ignore-case feature.

Further, this script exposed a previously unhandled remote graceful
cancellation case which hangs:

- parent actor spawns child and opens a >1 ctxs with it,
- the parent then OoB (out-of-band) cancels the child actor (with
  `Portal.cancel_actor()`),
- since the open ctxs raise a ctxc with a `.canceller == parent.uid` the
  `Context._is_self_cancelled()` will eval `True`,
- the `Context._scope` will NOT be cancelled in
  `._maybe_cancel_and_set_remote_error()` resulting in any bg-task which
  is waiting on a `Portal.open_context()` to not be cancelled/unblocked.

So my plan is to factor this ^^ scenario into a standalone unit test
as well as another test which consumes from al low-level `trio`-only
version of **this** script-scenario to sanity check the interaction
of the unmasker-with-ignore-cases usage implicitly around a ctx ep.
2025-09-06 14:03:02 -04:00
..
devx Add a root-already-cancelled crash handling test 2025-08-20 10:18:52 -04: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 Type annot the `testdir` fixture 2025-07-14 00:00:13 -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 Handle unconsidered fault-edge cases for UDS 2025-07-13 15:26:37 -04: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 Drop stale comment from inter-peer suite 2025-07-18 00:35:35 -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_multi_program.py Finally switch to using address protocol in all runtime 2025-07-08 12:57:28 -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 Add `.trionics.maybe_open_context()` locking test 2025-08-18 21:07:12 -04: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 Add a ignore-masking-case script + suite 2025-09-06 14:03:02 -04:00