From d35149e5ca8ead22258047f10a8fd21c5947f42b Mon Sep 17 00:00:00 2001 From: lisa neigut Date: Tue, 21 Apr 2020 18:51:13 -0500 Subject: [PATCH] try to fix travis test flakes --- tests/test_connection.py | 6 +++--- tests/test_plugin.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index bf405ca83..77895b28a 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -852,10 +852,10 @@ def test_funding_push(node_factory, bitcoind): funds = only_one(l1.rpc.listfunds()['channels']) 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) + l1.daemon.wait_for_log('coins account: {}'.format(chanid)) + # give the file write a second + time.sleep(1) channel_mvts = [ {'type': 'chain_mvt', 'credit': 0, 'debit': 20000000, 'tag': 'pushed'}, {'type': 'chain_mvt', 'credit': 16777215000, 'debit': 0, 'tag': 'deposit'}, diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 31f5f4dcd..702ef24c8 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -1434,22 +1434,29 @@ def test_coin_movement_notices(node_factory, bitcoind): # restart to test index 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) chan3 = l2.get_channel_scid(l3) chanid_1 = first_channel_id(l2, l1) chanid_3 = first_channel_id(l2, l3) 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 bitcoind.generate_block(6) sync_blockheight(bitcoind, [l2]) l2.daemon.wait_for_log('{}.*FUNDING_TRANSACTION/FUNDING_OUTPUT->MUTUAL_CLOSE depth'.format(l1.info['id'])) 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 bitcoind.generate_block(6) sync_blockheight(bitcoind, [l2])