Commit 7de6971
Stop networks that a test recovers into
Two governance_test nodes outlived their test by about 8.5 minutes in CI,
logging roughly 660 lines a minute on a join retry loop through the rest of
the bucket.
`test_all_members` stops the network it is given and recovers into a new one,
which it returns. `gov` rebound its local `network` to that, but the enclosing
`infra.network.network` context manager still owns the original, so nothing
ever stopped the recovered network. The nodes that leaked were the ones
`test_no_quote` and `test_node_data` deliberately add without ever trusting,
which is why they sat retrying rather than exiting.
Give `gov` explicit ownership of the recovered network and stop it in a
finally block. The node logs of the leaked nodes were clean, so this reaps
them without newly failing on anything.
`partitions_test.run_recovery_elections` has the same shape:
`test_recovery_elections` stops both the original and its intermediate network
but returns a third that nobody stopped. Fix it the same way, which matters
more now that the partitions groups run concurrently and a stray node is a
neighbour of a live test rather than of an idle runner.
The pattern is wider than these two: any test that recovers into a new network
and returns it leaks unless its caller takes ownership, and recovery.py does
this in several places. Left alone here.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 24ad6978-a80f-45bc-b73b-268aeaf2b30e1 parent c2f76f2 commit 7de6971
2 files changed
Lines changed: 30 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
581 | 591 | | |
582 | 592 | | |
583 | 593 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1607 | 1607 | | |
1608 | 1608 | | |
1609 | 1609 | | |
1610 | | - | |
1611 | | - | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
1612 | 1620 | | |
1613 | 1621 | | |
1614 | 1622 | | |
| |||
0 commit comments