Skip to content

Commit 8d54a82

Browse files
committed
pytest: fix CI hang.
This finally happened on my local build machine, so I tracked it down using py-spy, `apt-get install python3-dbg` and `py-local`. Turns out the dev-memleak command was hanging, and the processes were stuck in SIGSTOP. There are only two places we send that, and sure enough, this was the test which was running at the time. Signed-off-by: Rusty Russell <[email protected]>
1 parent c35c06c commit 8d54a82

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/test_connection.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4752,12 +4752,19 @@ def test_connect_ratelimit(node_factory, bitcoind):
47524752
# Suspend the others, to make sure they cannot respond too fast.
47534753
for n in nodes:
47544754
os.kill(n.daemon.proc.pid, signal.SIGSTOP)
4755-
l1.start()
47564755

4757-
# The first will be ok, but others should block and be unblocked.
4758-
l1.daemon.wait_for_logs((['Unblocking for ']
4759-
+ ['Too many connections, waiting'])
4760-
* (len(nodes) - 1))
4756+
try:
4757+
l1.start()
4758+
4759+
# The first will be ok, but others should block and be unblocked.
4760+
l1.daemon.wait_for_logs((['Unblocking for ']
4761+
+ ['Too many connections, waiting'])
4762+
* (len(nodes) - 1))
4763+
except Exception as err:
4764+
# Resume, so pytest doesn't hang!
4765+
for n in nodes:
4766+
os.kill(n.daemon.proc.pid, signal.SIGCONT)
4767+
raise err
47614768

47624769
# Resume them
47634770
for n in nodes:

0 commit comments

Comments
 (0)