Skip to content

Commit

Permalink
pytest: handle more expected broken messages.
Browse files Browse the repository at this point in the history
Once we fix our broken log detection, we find some we were missing.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Aug 15, 2024
1 parent fb3579c commit 74c906e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
8 changes: 6 additions & 2 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,9 @@ def test_penalty_inhtlc(node_factory, bitcoind, executor, chainparams, anchors):

# FIXME: | for dicts was added in Python 3.9 apparently.
l1, l2 = node_factory.line_graph(2, opts=[{**opts, **{'may_fail': True,
'feerates': (7500, 7500, 7500, 7500)}},
'feerates': (7500, 7500, 7500, 7500),
# We try to cheat!
'broken_log': r"onchaind-chan#[0-9]*: Could not find resolution for output .*: did \*we\* cheat\?"}},
opts])

channel_id = first_channel_id(l1, l2)
Expand Down Expand Up @@ -646,7 +648,9 @@ def test_penalty_outhtlc(node_factory, bitcoind, executor, chainparams, anchors)
# Feerates identical so we don't get gratuitous commit to update them
l1, l2 = node_factory.line_graph(2,
opts=[{**opts, **{'may_fail': True,
'feerates': (7500, 7500, 7500, 7500)}},
'feerates': (7500, 7500, 7500, 7500),
# We try to cheat!
'broken_log': r"onchaind-chan#[0-9]*: Could not find resolution for output .*: did \*we\* cheat\?"}},
opts])
channel_id = first_channel_id(l1, l2)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,8 @@ def test_dump_own_gossip(node_factory):
def test_listchannels_deprecated_local(node_factory, bitcoind):
"""Test listchannels shows local/private channels only in deprecated mode"""
l1, l2, l3 = node_factory.get_nodes(3,
opts=[{}, {'allow-deprecated-apis': True}, {}])
opts=[{}, {'allow-deprecated-apis': True,
'broken_log': 'plugin-topology: DEPRECATED API USED: listchannels.include_private'}, {}])
# This will be in block 103
node_factory.join_nodes([l1, l2], wait_for_announce=False)
l1l2 = first_scid(l1, l2)
Expand Down
6 changes: 4 additions & 2 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,8 @@ def check_new_log():
@unittest.skipIf(VALGRIND,
"Valgrind sometimes fails assert on injected SEGV")
def test_crashlog(node_factory):
l1 = node_factory.get_node(may_fail=True)
l1 = node_factory.get_node(may_fail=True,
broken_log=' lightningd: ')

def has_crash_log(n):
files = os.listdir(os.path.join(n.daemon.lightning_dir, TEST_NETWORK))
Expand Down Expand Up @@ -2305,7 +2306,8 @@ def test_dev_force_bip32_seed(node_factory):


def test_dev_demux(node_factory):
l1 = node_factory.get_node(may_fail=True)
l1 = node_factory.get_node(may_fail=True,
broken_log=' lightningd: ')

# Check should work.
l1.rpc.check(command_to_check='dev', subcommand='crash')
Expand Down
6 changes: 4 additions & 2 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ def test_libplugin_deprecated(node_factory):
'somearg-deprecated': 'test_opt depr',
'allow-deprecated-apis': True},
# testrpc-deprecated causes a complaint!
)
broken_log='DEPRECATED API USED')

assert l1.daemon.is_in_log("somearg = test_opt depr")
l1.rpc.help('testrpc-deprecated')
Expand Down Expand Up @@ -2006,7 +2006,9 @@ def test_watchtower(node_factory, bitcoind, directory, chainparams):
p = os.path.join(os.path.dirname(__file__), "plugins/watchtower.py")
l1, l2 = node_factory.line_graph(
2,
opts=[{'may_fail': True}, {'plugin': p}]
opts=[{'may_fail': True,
'broken_log': r"onchaind-chan#[0-9]*: Could not find resolution for output .*: did \*we\* cheat\?"},
{'plugin': p}]
)
channel_id = l1.rpc.listpeerchannels()['channels'][0]['channel_id']

Expand Down

0 comments on commit 74c906e

Please sign in to comment.