try to fix travis test flakes

This commit is contained in:
lisa neigut 2020-04-21 18:51:13 -05:00 committed by Rusty Russell
parent 487771aee5
commit d35149e5ca
2 changed files with 13 additions and 6 deletions

View File

@ -852,10 +852,10 @@ def test_funding_push(node_factory, bitcoind):
funds = only_one(l1.rpc.listfunds()['channels']) funds = only_one(l1.rpc.listfunds()['channels'])
assert funds['channel_sat'] + push_sat == funds['channel_total_sat'] assert funds['channel_sat'] + push_sat == funds['channel_total_sat']
l1.daemon.wait_for_log('1 coins')
# we have to give the file write a second
time.sleep(1)
chanid = first_channel_id(l2, l1) chanid = first_channel_id(l2, l1)
l1.daemon.wait_for_log('coins account: {}'.format(chanid))
# give the file write a second
time.sleep(1)
channel_mvts = [ channel_mvts = [
{'type': 'chain_mvt', 'credit': 0, 'debit': 20000000, 'tag': 'pushed'}, {'type': 'chain_mvt', 'credit': 0, 'debit': 20000000, 'tag': 'pushed'},
{'type': 'chain_mvt', 'credit': 16777215000, 'debit': 0, 'tag': 'deposit'}, {'type': 'chain_mvt', 'credit': 16777215000, 'debit': 0, 'tag': 'deposit'},

View File

@ -1434,22 +1434,29 @@ def test_coin_movement_notices(node_factory, bitcoind):
# restart to test index # restart to test index
l2.restart() l2.restart()
wait_for(lambda: all(p['channels'][0]['state'] == 'CHANNELD_NORMAL' for p in l2.rpc.listpeers()['peers']))
# close the channel down # close the channels down
chan1 = l2.get_channel_scid(l1) chan1 = l2.get_channel_scid(l1)
chan3 = l2.get_channel_scid(l3) chan3 = l2.get_channel_scid(l3)
chanid_1 = first_channel_id(l2, l1) chanid_1 = first_channel_id(l2, l1)
chanid_3 = first_channel_id(l2, l3) chanid_3 = first_channel_id(l2, l3)
l2.rpc.close(chan1) l2.rpc.close(chan1)
l2.daemon.wait_for_log(' to CLOSINGD_SIGEXCHANGE') l2.daemon.wait_for_logs([
' to CLOSINGD_COMPLETE',
'sendrawtx exit 0',
])
assert account_balance(l2, chanid_1) == 100001001 assert account_balance(l2, chanid_1) == 100001001
bitcoind.generate_block(6) bitcoind.generate_block(6)
sync_blockheight(bitcoind, [l2]) sync_blockheight(bitcoind, [l2])
l2.daemon.wait_for_log('{}.*FUNDING_TRANSACTION/FUNDING_OUTPUT->MUTUAL_CLOSE depth'.format(l1.info['id'])) l2.daemon.wait_for_log('{}.*FUNDING_TRANSACTION/FUNDING_OUTPUT->MUTUAL_CLOSE depth'.format(l1.info['id']))
l2.rpc.close(chan3) l2.rpc.close(chan3)
l2.daemon.wait_for_log(' to CLOSINGD_SIGEXCHANGE') l2.daemon.wait_for_logs([
' to CLOSINGD_COMPLETE',
'sendrawtx exit 0',
])
assert account_balance(l2, chanid_3) == 950000501 assert account_balance(l2, chanid_3) == 950000501
bitcoind.generate_block(6) bitcoind.generate_block(6)
sync_blockheight(bitcoind, [l2]) sync_blockheight(bitcoind, [l2])