mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-04 11:08:03 +01:00
pytest: fix flake in test_node_reannounce
Again, our new behaviour of sending our own gossip even before they ask can confuse our gossip query tests. In this case, simply eliminate duplicates. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
a677ea404b
commit
25699994e5
1 changed files with 7 additions and 0 deletions
|
@ -1263,6 +1263,8 @@ def test_node_reannounce(node_factory, bitcoind, chainparams):
|
||||||
# And pings.
|
# And pings.
|
||||||
filters=['0109', '0107', '0102', '0100', '0012'])
|
filters=['0109', '0107', '0102', '0100', '0012'])
|
||||||
|
|
||||||
|
# May send its own announcement *twice*, since it always spams us.
|
||||||
|
msgs = list(set(msgs))
|
||||||
assert len(msgs) == 2
|
assert len(msgs) == 2
|
||||||
assert (bytes("SENIORBEAM", encoding="utf8").hex() in msgs[0]
|
assert (bytes("SENIORBEAM", encoding="utf8").hex() in msgs[0]
|
||||||
or bytes("SENIORBEAM", encoding="utf8").hex() in msgs[1])
|
or bytes("SENIORBEAM", encoding="utf8").hex() in msgs[1])
|
||||||
|
@ -1277,6 +1279,9 @@ def test_node_reannounce(node_factory, bitcoind, chainparams):
|
||||||
# channel_announcement and channel_updates.
|
# channel_announcement and channel_updates.
|
||||||
# And pings.
|
# And pings.
|
||||||
filters=['0109', '0107', '0102', '0100', '0012'])
|
filters=['0109', '0107', '0102', '0100', '0012'])
|
||||||
|
|
||||||
|
# May send its own announcement *twice*, since it always spams us.
|
||||||
|
msgs2 = list(set(msgs2))
|
||||||
assert msgs == msgs2
|
assert msgs == msgs2
|
||||||
# Won't have queued up another one, either.
|
# Won't have queued up another one, either.
|
||||||
assert not l1.daemon.is_in_log('node_announcement: delaying')
|
assert not l1.daemon.is_in_log('node_announcement: delaying')
|
||||||
|
@ -1295,6 +1300,7 @@ def test_node_reannounce(node_factory, bitcoind, chainparams):
|
||||||
assert ad['channel_fee_max_base_msat'] == Millisatoshi('2000msat')
|
assert ad['channel_fee_max_base_msat'] == Millisatoshi('2000msat')
|
||||||
assert ad['channel_fee_max_proportional_thousandths'] == 22
|
assert ad['channel_fee_max_proportional_thousandths'] == 22
|
||||||
|
|
||||||
|
# May send its own announcement *twice*, since it always spams us.
|
||||||
msgs2 = l1.query_gossip('gossip_timestamp_filter',
|
msgs2 = l1.query_gossip('gossip_timestamp_filter',
|
||||||
genesis_blockhash,
|
genesis_blockhash,
|
||||||
'0', '0xFFFFFFFF',
|
'0', '0xFFFFFFFF',
|
||||||
|
@ -1302,6 +1308,7 @@ def test_node_reannounce(node_factory, bitcoind, chainparams):
|
||||||
# channel_announcement and channel_updates.
|
# channel_announcement and channel_updates.
|
||||||
# And pings.
|
# And pings.
|
||||||
filters=['0109', '0107', '0102', '0100', '0012'])
|
filters=['0109', '0107', '0102', '0100', '0012'])
|
||||||
|
msgs2 = list(set(msgs2))
|
||||||
assert msgs != msgs2
|
assert msgs != msgs2
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue