Add anti-hang `fail_after` cap to aio-cancel test
Wrap `test_tractor_cancels_aio`'s `main()` in a `trio.fail_after(9 * cpu_perf_headroom())` so a wedged remote runtime can't hang the test forever. This is the blessed anti-hang guard here bc `pytest-timeout`'s global cap is intentionally off (it breaks `trio` under the fork backends, per the `pyproject` NOTE). The cap is generous + CPU-headroom-scaled bc it's an anti-hang guard, not a perf assertion. Motivated by the `._ria_nursery`-removal regression where a wedged ria-reaper once hung this exact test indefinitely. (this patch was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-codedrop_ria_nursery
parent
e617b498ec
commit
d1fb4a1a26
|
|
@ -207,6 +207,15 @@ def test_tractor_cancels_aio(
|
|||
|
||||
'''
|
||||
async def main():
|
||||
# anti-hang wall-clock cap: a per-test `trio.fail_after`
|
||||
# is the blessed guard here since `pytest-timeout`'s
|
||||
# global cap is intentionally off (see the `pyproject`
|
||||
# NOTE — it breaks trio under fork backends). Generous +
|
||||
# CPU-headroom-scaled bc this is an anti-hang guard, not
|
||||
# a perf assertion; a wedged ria-reaper once hung this
|
||||
# test forever (the `._ria_nursery`-removal regression).
|
||||
from .conftest import cpu_perf_headroom
|
||||
with trio.fail_after(9 * cpu_perf_headroom()):
|
||||
async with tractor.open_nursery(
|
||||
debug_mode=debug_mode,
|
||||
registry_addrs=[reg_addr],
|
||||
|
|
|
|||
Loading…
Reference in New Issue