From ba1d9aaff02861396a0177867a9acb2cb4e009b3 Mon Sep 17 00:00:00 2001 From: niftynei Date: Mon, 28 Feb 2022 14:38:23 -0600 Subject: [PATCH] coin move flake: randomly fails on CI because there's 1 'penalty' event Flaky test happening because l1 doesn't have the second 'penalty' event registered yet. ``` # l1 loses all of their channel balance to the peer, as penalties expected_1 = { '0': [('wallet', ['deposit'], ['withdrawal'], 'A')], 'A': [('wallet', ['deposit'], None, None), ('cid1', ['channel_open', 'opener'], ['channel_close'], 'B')], 'B': [('external', ['penalty'], None, None), ('external', ['penalty'], None, None)], } ... # We use a subset of tags in expected_2 that are used in expected_1 > tags = check_utxos_channel(l1, [channel_id], expected_1) tests/test_closing.py:661: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/utils.py:321: in check_utxos_channel txid = matchup_events(u_set, evs, chans, tag_list) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ u_set = [[{'account_id': 'external', 'blockheight': 104, 'coin_type': 'bcrt', 'credit': '100000000msat', ...}, None]] evs = [('external', ['penalty'], None, None), ('external', ['penalty'], None, None)] chans = ['9e9e0784560f1a01000f27d8da1352e5d332823c441c2871cf5a9409e3989ff6'] tag_list = {'0': '2d8a44e1541d679c487116c6bbf115a1cf8a00f9292fc6567e579bb378488113', 'A': 'f79f98e309945acf71281c443c8232d3e55213dad8270f00011a0f5684079e9e', 'B': '2a2a72017c76ae503eac667c363c06480d2d966082af9912ee0997f9afc424e9'} def matchup_events(u_set, evs, chans, tag_list): > assert len(u_set) == len(evs) and len(u_set) > 0 E AssertionError tests/utils.py:237: AssertionError ``` --- tests/test_closing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index d23c3affd37b..e4ad72ec7b6f 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -610,7 +610,7 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams): bitcoind.generate_block(100) - sync_blockheight(bitcoind, [l2]) + sync_blockheight(bitcoind, [l1, l2]) wait_for(lambda: len(l2.rpc.listpeers()['peers']) == 0) # Do one last pass over the logs to extract the reactions l2 sent