Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest: catch more broken messages in test_important_plugins. #7253

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ def test_last_tx_psbt_upgrade(node_factory, bitcoind):
upgraded_psbts = ['cHNidP8BAgQCAAAAAQME74HcIAEEAQEBBQEDAQYBAwH7BAIAAAAAAQErQEIPAAAAAAAiACCiWhNhgwfpKsHIgLqGzpSdj8cCpITLFVpVRddsOobajiICAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLRzBEAiBhqTjjdJx2TqTNUwYJgmjhH6p8FJnbnj/N/Jv0dEiQmwIgXG/ki8U0iN0YPbrhpl7goGhXUj/8+JRg0uKLJrkHLrsBAQMEAQAAAAEFR1IhAgZUBJOphZmWemHEUXLfSWgeOYpssIkKUG5092wtK+JCIQIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxS1KuIgYCBlQEk6mFmZZ6YcRRct9JaB45imywiQpQbnT3bC0r4kIIWA8TsgAAAAAiBgIyQmbehAOzqxV6CfH3hNWHr2GDHJmMFRvMIbt0wrIxSwhK0xNpAAAAAAEOII3WmYYbAAYeUJN6Iz21hL+O1MC/ULRMBBH3GwMaBkVQAQ8EAAAAAAEQBA73qYAAAQMIUMMAAAAAAAABBCIAIHM1bP9+FYjxSTXvE44UKr77X349Ud6UJ1jc1aF5RJtiAAEDCFCpBgAAAAAAAQQiACAt9UXqiCiJhGxS/F4RGsB84H4MCUGKwVdDpvYoTCpPpwABAwggoQcAAAAAAAE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AAiBgLWBj0CJpGySQq0VN7nOlfG/10wg1K0YezmnzwoTywkEgj9r2whAAAAAAEOIDXaspluV3YuPsFYwNV9OfQ8plfogtk/wk9f66qPNu2aAQ8EAQAAAAEQBFZtHYAAAQMIUMMAAAAAAAABBCIAIFZ5p9BuG9J2qiX1bp5N9+B9mDfvsMX2NgTxDNn3ZqA+AAEDCNTdBgAAAAAAAQQWABR+W1yPT8GpSE4ln5LKTLt/ooFOpAABAwiabAcAAAAAAAEEIgAgq2Im3r/+/0p0HAE2f6PIdRckg8+z4yfQ+MeqTFHt7KoA']

l1 = node_factory.get_node(dbfile='last_tx_upgrade.sqlite3.xz',
# FIXME: gossipd gets upset, since it seems like the db with remote announcement_sigs was
# actually from l2, not l1. But if we make this l1, then last_tx changes
broken_log='gossipd rejected our channel announcement',
allow_bad_gossip=True,
options={'database-upgrade': True})

b64_last_txs = [base64.b64encode(x['last_tx']).decode('utf-8') for x in l1.db_query('SELECT last_tx FROM channels ORDER BY id;')]
Expand All @@ -207,6 +211,8 @@ def test_last_tx_psbt_upgrade(node_factory, bitcoind):
time.sleep(2)

l2 = node_factory.get_node(dbfile='last_tx_closed.sqlite3.xz',
broken_log='gossipd rejected our channel announcement',
allow_bad_gossip=True,
options={'database-upgrade': True})
last_txs = [x['last_tx'] for x in l2.db_query('SELECT last_tx FROM channels ORDER BY id;')]

Expand All @@ -215,12 +221,6 @@ def test_last_tx_psbt_upgrade(node_factory, bitcoind):

bitcoind.rpc.decoderawtransaction(last_txs[1].hex())

# FIXME: gossipd gets upset, since it seems like the db with remote announcement_sigs was
# actually from l2, not l1. But if we make this l1, then last_tx changes, so we just
# filter out gossipd messages here (we will still detect other broken msgs!)
l1.daemon.logs = [l for l in l1.daemon.logs if 'gossipd' not in l]
l2.daemon.logs = [l for l in l2.daemon.logs if 'gossipd' not in l]


@pytest.mark.slow_test
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
Expand Down
3 changes: 2 additions & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2191,7 +2191,8 @@ def test_important_plugin(node_factory):

n = node_factory.get_node(options={"important-plugin": os.path.join(pluginsdir, "nonexistent")},
may_fail=True, expect_fail=True,
broken_log='Plugin marked as important, shutting down lightningd',
# Other plugins can complain as lightningd stops suddenly:
broken_log='Plugin marked as important, shutting down lightningd|Reading JSON input: Connection reset by peer',
start=False)

n.daemon.start(wait_for_initialized=False, stderr_redir=True)
Expand Down
Loading