tractor/tests/discovery
Gud Boi 13b47d07c6 Fix mutual-rendezvous premature-reap race (#477)
The `test_trynamic_trio` + `a_trynamic_first_scene.py` migration
to paired `to_actor.run()` one-shots carries a race the legacy
`run_in_actor()` shape never had: donny + gretchen each
`wait_for_actor()` (then DIAL) the *other*, but a one-shot is
reaped the instant its own hello returns — so the slower peer
can resolve the winner's registry entry and connect to an
already-dead sockaddr -> `ConnectionRefusedError` boxed as a
`RemoteActorError` (or a reg-wait `TooSlowError`), flaking
~1-in-3 standalone runs.

Mutual-rendezvous peers must OUTLIVE both dialogs, so pin the
lifetimes explicitly: `start_actor()` both as daemons, run both
hellos concurrently via bg `Portal.run()` tasks, then reap with
`an.cancel()` only after the task-nursery joins. (The legacy
teardown-reap provided this pinning implicitly — one of the
few places its semantics were ever actually relied upon.)

Gate: `-k trynamic` standalone x8 green (was flaking); full
`test_registrar` module + the example-runner green.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-08-19 15:46:04 -04:00
..
__init__.py Add `test_multiaddr.py` suite for `mk_maddr()` 2026-04-14 19:54:14 -04:00
conftest.py Document stable macOS UDS operation 2026-08-14 10:37:19 -04:00
test_daemon_fixture.py Move registrar probes to `discovery._api` 2026-08-14 18:43:36 -04:00
test_multi_program.py Use `aid.uid` over manual `(name, uuid)` tuples 2026-06-27 21:38:30 -04:00
test_multiaddr.py Add `parse_endpoints()` to `_multiaddr` 2026-04-14 19:54:14 -04:00
test_registrar.py Fix mutual-rendezvous premature-reap race (#477) 2026-08-19 15:46:04 -04:00
test_tpt_bind_addrs.py Move registrar probes to `discovery._api` 2026-08-14 18:43:36 -04:00