Skip to content

Commit

Permalink
try to fix travis test flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
niftynei committed May 1, 2020
1 parent e748284 commit 102bdb8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
13 changes: 10 additions & 3 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,22 +1279,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])
Expand Down

0 comments on commit 102bdb8

Please sign in to comment.