Skip to content

Commit

Permalink
pytest: test (fail) that we don't repeat gossip back to the node we g…
Browse files Browse the repository at this point in the history
…ot it from

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Sep 6, 2019
1 parent 1e7b127 commit 5292f11
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,3 +1375,22 @@ def test_gossip_announce_unknown_block(node_factory, bitcoind):

# Make sure it's OK once it's caught up.
sync_blockheight(bitcoind, [l1])


@pytest.mark.xfail(strict=True)
@unittest.skipIf(not DEVELOPER, "gossip without DEVELOPER=1 is slow")
def test_gossip_no_backtalk(node_factory):
l1, l2 = node_factory.line_graph(2, wait_for_announce=True)

# This connects, gets gossip, but should *not* play it back.
l3 = node_factory.get_node(log_all_io=True)

l3.rpc.connect(l2.info['id'], 'localhost', l2.port)
# Will get channel_announce, then two channel_update and two node_announcement
l3.daemon.wait_for_logs([r'\[IN\] 0100',
r'\[IN\] 0102', r'\[IN\] 0102',
r'\[IN\] 0101', r'\[IN\] 0101'])

# With DEVELOPER, this is long enough for gossip flush.
time.sleep(2)
assert not l3.daemon.is_in_log(r'\[OUT\] 0100')

0 comments on commit 5292f11

Please sign in to comment.