Browse Source

pytest: don't time out on test_pay_direct !DEVELOPER

Travis timed out.

Waiting for three fundchannel commands depends on the bitcoind polling
interval (30 seconds), and then waiting for gossip propagation
requires two propagation intervals (120 seconds).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
fix-test_pay_direct-flake
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
fbf2168902
  1. 13
      tests/test_pay.py

13
tests/test_pay.py

@ -1356,20 +1356,23 @@ def test_pay_direct(node_factory, bitcoind):
# Direct channel l0->l1->l3 # Direct channel l0->l1->l3
l0.rpc.connect(l1.info['id'], 'localhost', l1.port) l0.rpc.connect(l1.info['id'], 'localhost', l1.port)
l0.fund_channel(l1, 10**7) # Waiting takes a *long* time if !DEVELOPER.
l0.fund_channel(l1, 10**7, wait_for_active=False)
l1.rpc.connect(l3.info['id'], 'localhost', l3.port) l1.rpc.connect(l3.info['id'], 'localhost', l3.port)
l1.fund_channel(l3, 10**7) l1.fund_channel(l3, 10**7, wait_for_active=False)
# Indirect route l0->l1->l2->l3 # Indirect route l0->l1->l2->l3
l1.rpc.connect(l2.info['id'], 'localhost', l2.port) l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
l1.fund_channel(l2, 10**7) l1.fund_channel(l2, 10**7, wait_for_active=False)
l2.rpc.connect(l3.info['id'], 'localhost', l3.port) l2.rpc.connect(l3.info['id'], 'localhost', l3.port)
c3 = l2.fund_channel(l3, 10**7) c3 = l2.fund_channel(l3, 10**7, wait_for_active=False)
# Let channels lock in. # Let channels lock in.
bitcoind.generate_block(5) bitcoind.generate_block(5)
# Make sure l0 knows the l2->l3 channel. # Make sure l0 knows the l2->l3 channel.
l0.wait_channel_active(c3) # Without DEVELOPER, channel lockin can take 30 seconds to detect,
# and gossip 2 minutes to propagate
wait_for(lambda: l0.is_channel_active(c3), timeout=180)
# Find out how much msatoshi l1 owns on l1->l2 channel. # Find out how much msatoshi l1 owns on l1->l2 channel.
l1l2msatreference = only_one(l1.rpc.getpeer(l2.info['id'])['channels'])['msatoshi_to_us'] l1l2msatreference = only_one(l1.rpc.getpeer(l2.info['id'])['channels'])['msatoshi_to_us']

Loading…
Cancel
Save