tractor/tests
Gud Boi f84ef44992 Repair lifetime-stack suite's flakiness
Event on linux i was noticing lotsa false negatives based on sub
teardown race conditions, so this tries to both make way for
(eventually?) expanding the set of suite cases and ensure the current
ones are more reliable on every run.

The main change is to hange the `error_in_child=False` case to use
parent-side-cancellation via a new `trio.move_on_after(timeout)` instead
of `actor.cancel_soon()` (which is now toggled by a new `self_cancel:
bool` but unused rn), and add better teardown assertions.

Low level deats,
- add `rent_cancel`/`self_cancel` params to
  `crash_and_clean_tmpdir()` for different cancel paths;
  default to `rent_cancel=True` which just sleeps forever
  letting the parent's timeout do the work.
- use `trio.move_on_after()` with longer timeouts per
  case: 1.6s for error, 1s for cancel.
- use the `.move_on_after()` cancel-scope to assert `.cancel_called`
  pnly when `error_in_child=False`, indicating we
  parent-graceful-cancelled the sub.
- add `loglevel` fixture, pass to `open_nursery()`.
- log caught `RemoteActorError` via console logger.
- add `ids=` to parametrize for readable test names.

(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-03-13 21:10:52 -04:00
..
devx Skip a couple more `ctlc` flaking suites 2026-03-09 19:31:16 -04:00
ipc Add note about `--tpt-proto` controlling `reg_addr`-type 2026-03-13 21:10:52 -04:00
msg Drop unused import noticed by `copilot` 2026-03-13 11:52:18 -04:00
__init__.py Add `tests/__init__.py` for `.conftest` imports 2025-03-20 20:53:54 -04:00
conftest.py Xplatform tweaks for `daemon` fixture 2026-03-09 19:30:41 -04:00
test_2way.py Tidy a typing-typo, add explicit `ids=` for paramed suites 2026-03-09 19:35:47 -04:00
test_advanced_faults.py Fix `spawn` fixture cleanup + test assertions 2026-02-19 16:14:11 -05:00
test_advanced_streaming.py Remove lingering seg=False-flags from tests 2025-08-18 12:03:32 -04:00
test_cancellation.py Another cancellation test timeout bump for non-linux 2026-03-09 19:46:42 -04:00
test_child_manages_service_nursery.py Swap `open_channel_from()` to yield `(chan, first)` 2026-03-13 19:28:57 -04:00
test_clustering.py Wrap cluster test in `trio.fail_after()` 2026-03-13 21:10:52 -04:00
test_context_stream_semantics.py Longer timeout for `test_one_end_stream_not_opened` 2026-03-09 19:29:18 -04:00
test_discovery.py Fill out types in `test_discovery` mod 2026-03-09 19:30:41 -04:00
test_docs_examples.py OK-FINE, skip streaming docs example on macos! 2026-03-09 19:46:42 -04:00
test_infected_asyncio.py Swap `open_channel_from()` to yield `(chan, first)` 2026-03-13 19:28:57 -04:00
test_inter_peer_cancellation.py Use test-harness `loglevel` in inter-peer suite 2026-02-19 16:29:20 -05:00
test_legacy_one_way_streaming.py Restyle `test_legacy_one_way_streaming` mod 2026-03-09 19:46:25 -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 Add delay before root-actor open, macos in CI.. 2026-03-09 19:30:41 -04:00
test_oob_cancellation.py Woops, fix missing `assert` thanks to copilot 2025-09-11 13:13:18 -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 Swap `open_channel_from()` to yield `(chan, first)` 2026-03-13 19:28:57 -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 Repair lifetime-stack suite's flakiness 2026-03-13 21:10:52 -04:00
test_shm.py Loosen shml test assert for key shortening on macos 2026-03-09 19:29:18 -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