test: adds wait mempool to flaky tests

This commit is contained in:
Michael Schmoock 2019-06-04 11:33:24 +02:00 committed by Rusty Russell
parent dd87024060
commit c40250ad0b
2 changed files with 5 additions and 6 deletions

View file

@ -992,7 +992,7 @@ def test_funding_reorg_remote_lags(node_factory, bitcoind):
'CHANNELD_NORMAL:Funding transaction locked. Channel announced.']) 'CHANNELD_NORMAL:Funding transaction locked. Channel announced.'])
l1.rpc.close(l2.info['id']) # to ignore `Bad gossip order` error in killall l1.rpc.close(l2.info['id']) # to ignore `Bad gossip order` error in killall
bitcoind.generate_block(1) bitcoind.generate_block(1, True)
l1.daemon.wait_for_log(r'Deleting channel') l1.daemon.wait_for_log(r'Deleting channel')
l2.daemon.wait_for_log(r'Deleting channel') l2.daemon.wait_for_log(r'Deleting channel')

View file

@ -299,9 +299,9 @@ def test_openchannel_hook(node_factory, bitcoind):
# Get some funds. # Get some funds.
addr = l1.rpc.newaddr()['bech32'] addr = l1.rpc.newaddr()['bech32']
bitcoind.rpc.sendtoaddress(addr, 10) txid = bitcoind.rpc.sendtoaddress(addr, 10)
numfunds = len(l1.rpc.listfunds()['outputs']) numfunds = len(l1.rpc.listfunds()['outputs'])
bitcoind.generate_block(1) bitcoind.generate_block(1, txid)
wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > numfunds) wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > numfunds)
# Even amount: works. # Even amount: works.
@ -322,9 +322,8 @@ def test_openchannel_hook(node_factory, bitcoind):
l2.daemon.wait_for_log('reject_odd_funding_amounts.py to_self_delay=5') l2.daemon.wait_for_log('reject_odd_funding_amounts.py to_self_delay=5')
# Close it. # Close it.
l1.rpc.close(l2.info['id']) txid = l1.rpc.close(l2.info['id'])['txid']
wait_for(lambda: len(bitcoind.rpc.getrawmempool()) > 0) bitcoind.generate_block(1, txid)
bitcoind.generate_block(1)
wait_for(lambda: [c['state'] for c in only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['channels']] == ['ONCHAIN']) wait_for(lambda: [c['state'] for c in only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['channels']] == ['ONCHAIN'])
# Odd amount: fails # Odd amount: fails