Skip to content

Commit f6e7d0c

Browse files
committed
pytest: add test for crashing listpeers.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 562974a commit f6e7d0c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/test_connection.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,31 @@ def test_multifunding_simple(node_factory, bitcoind):
17981798
l1.rpc.pay(inv)
17991799

18001800

1801+
@pytest.mark.xfail(strict=True)
1802+
@pytest.mark.openchannel('v2')
1803+
def test_listpeers_crash(node_factory, bitcoind, executor):
1804+
'''
1805+
Test for listpeers crash during dual-funding start
1806+
'''
1807+
l1, l2 = node_factory.get_nodes(2)
1808+
1809+
do_listpeers = True
1810+
1811+
# Do lots of listpeers while this is happening
1812+
def lots_of_listpeers(node):
1813+
while do_listpeers:
1814+
node.rpc.listpeers()
1815+
1816+
fut = executor.submit(lots_of_listpeers, l1)
1817+
1818+
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
1819+
l1.fundwallet(10**6 + 1000000)
1820+
l1.rpc.fundchannel(l2.info['id'], 10**6)['tx']
1821+
1822+
do_listpeers = False
1823+
fut.result()
1824+
1825+
18011826
@pytest.mark.openchannel('v1')
18021827
@pytest.mark.openchannel('v2')
18031828
def test_multifunding_one(node_factory, bitcoind):

0 commit comments

Comments
 (0)