Commit 1af2121
committed
Wire
Stopgap companion to d012196 (`subint_forkserver`
test-cancellation leak doc): five tests in
`tests/test_cancellation.py` were running against the
default `:1616` registry, so any leaked
`subint-forkserv` descendant from a prior test holds
the port and blows up every subsequent run with
`TooSlowError` / "address in use". Thread the
session-unique `reg_addr` fixture through so each run
picks its own port — zombies can no longer poison
other tests (they'll only cross-contaminate whatever
happens to share their port, which is now nothing).
Deats,
- add `reg_addr: tuple` fixture param to:
- `test_cancel_infinite_streamer`
- `test_some_cancels_all`
- `test_nested_multierrors`
- `test_cancel_via_SIGINT`
- `test_cancel_via_SIGINT_other_task`
- explicitly pass `registry_addrs=[reg_addr]` to the
two `open_nursery()` calls that previously had no
kwargs at all (in `test_cancel_via_SIGINT` and
`test_cancel_via_SIGINT_other_task`)
- add bounded `@pytest.mark.timeout(7, method='thread')`
to `test_nested_multierrors` so a hung run doesn't
wedge the whole session
Still doesn't close the real leak — the
`subint_forkserver` backend's `_ForkedProc.kill()` is
PID-scoped not tree-scoped, so grandchildren survive
teardown regardless of registry port. This commit is
just blast-radius containment until that fix lands.
See `ai/conc-anal/
subint_forkserver_test_cancellation_leak_issue.md`.
(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-codereg_addr through leaky cancel tests1 parent e3f4f5a commit 1af2121
1 file changed
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| 345 | + | |
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
| |||
450 | 452 | | |
451 | 453 | | |
452 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
453 | 459 | | |
454 | 460 | | |
| 461 | + | |
455 | 462 | | |
456 | 463 | | |
457 | 464 | | |
| |||
541 | 548 | | |
542 | 549 | | |
543 | 550 | | |
| 551 | + | |
544 | 552 | | |
545 | 553 | | |
546 | 554 | | |
| |||
553 | 561 | | |
554 | 562 | | |
555 | 563 | | |
556 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
557 | 567 | | |
558 | 568 | | |
559 | 569 | | |
| |||
566 | 576 | | |
567 | 577 | | |
568 | 578 | | |
| 579 | + | |
569 | 580 | | |
570 | 581 | | |
571 | 582 | | |
| |||
594 | 605 | | |
595 | 606 | | |
596 | 607 | | |
597 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
598 | 611 | | |
599 | 612 | | |
600 | 613 | | |
| |||
0 commit comments