forked from goodboy/tractor
1
0
Fork 0
tractor/tractor
Tyler Goodlet a628eabb30 Officially test proto-ed `stackscope` integration
By re-purposing our `pexpect`-based console matching with a new
`debugging/shield_hang_in_sub.py` example, this tests a few "hanging
actor" conditions more formally:

- that despite a hanging actor's task we can dump
  a `stackscope.extract()` tree on relay of `SIGUSR1`.
- the actor tree will terminate despite a shielded forever-sleep by our
  "T-800" zombie reaper machinery activating and hard killing the
  underlying subprocess.

Some test deats:
- simulates the expect actions of a real user by manually using
  `os.kill()` to send both signals to the actor-tree program.
- `pexpect`-matches against `log.devx()` emissions under normal
  `debug_mode == True` usage.
- ensure we get the actual "T-800 deployed" `log.error()` msg and
  that the actor tree eventually terminates!

Surrounding (re-org/impl/test-suite) changes:
- allow disabling usage via a `maybe_enable_greenback: bool` to
  `open_root_actor()` but enable by def.
- pretty up the actual `.devx()` content from `.devx._stackscope`
  including be extra pedantic about the conc-primitives for each signal
  event.
- try to avoid double handles of `SIGUSR1` even though it seems the
  original (what i thought was a) problem was actually just double
  logging in the handler..
  |_ avoid double applying the handler func via `signal.signal()`,
  |_ use a global to avoid double handle func calls and,
  |_ a `threading.RLock` around handling.
- move common fixtures and helper routines from `test_debugger` to
  `tests/devx/conftest.py` and import them for use in both test mods.
2024-07-10 19:58:27 -04:00
..
_testing Move `mk_cmd()` to `._testing` 2024-07-10 15:40:44 -04:00
devx Officially test proto-ed `stackscope` integration 2024-07-10 19:58:27 -04:00
experimental Drop now-deprecated deps on modern `trio`/Python 2024-03-13 18:41:24 -04:00
msg Quieter `Stop` handling on ctx result capture 2024-07-03 22:42:32 -04:00
trionics Refine some `.trionics` docs and logging 2024-06-28 19:28:12 -04:00
__init__.py Finally implement peer-lookup optimization.. 2024-07-04 19:40:11 -04:00
_child.py Hide `._entry`/`._child` frames, tweak some more type annots 2024-04-14 17:49:18 -04:00
_clustering.py Passthrough runtime kwargs from `open_actor_cluster()` 2022-12-11 19:56:08 -05:00
_context.py More-n-more scops annots in logging 2024-07-04 15:06:15 -04:00
_discovery.py Finally implement peer-lookup optimization.. 2024-07-04 19:40:11 -04:00
_entry.py More-n-more scops annots in logging 2024-07-04 15:06:15 -04:00
_exceptions.py More formal `TransportClosed` reporting/raising 2024-07-02 12:21:26 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_ipc.py More formal `TransportClosed` reporting/raising 2024-07-02 12:21:26 -04:00
_mp_fixup_main.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_multiaddr.py Fix doc string "its" typo.. 2023-11-06 15:44:21 -05:00
_portal.py More-n-more scops annots in logging 2024-07-04 15:06:15 -04:00
_root.py Officially test proto-ed `stackscope` integration 2024-07-10 19:58:27 -04:00
_rpc.py More formal `TransportClosed` reporting/raising 2024-07-02 12:21:26 -04:00
_runtime.py Finally implement peer-lookup optimization.. 2024-07-04 19:40:11 -04:00
_shm.py Drop now-deprecated deps on modern `trio`/Python 2024-03-13 18:41:24 -04:00
_spawn.py Use `._entry` proto-ed "lifetime ops" in logging 2024-07-02 16:31:58 -04:00
_state.py Further formalize `greenback` integration 2024-06-28 14:45:45 -04:00
_streaming.py Reraise RAEs in `MsgStream.receive()`; truncate tbs 2024-07-02 16:31:15 -04:00
_supervise.py Prep for legacy RPC API factor-n-remove 2024-06-27 16:25:46 -04:00
log.py Woops, set `.cancel()` level in custom levels table.. 2024-06-28 19:27:13 -04:00
to_asyncio.py Use `delay=0` in pump loop.. 2024-06-27 19:27:59 -04:00