Skip to content

Commit

Permalink
pytest: failing test for overflow in query_channel_range
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jan 15, 2019
1 parent 39425e7 commit a4fe50c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_gossip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import logging
import os
import pytest
import struct
import subprocess
import time
Expand Down Expand Up @@ -547,6 +548,7 @@ def check_gossip(n):


@unittest.skipIf(not DEVELOPER, "needs DEVELOPER=1")
@pytest.mark.xfail(strict=True)
def test_gossip_query_channel_range(node_factory, bitcoind):
l1, l2, l3, l4 = node_factory.line_graph(4, opts={'log-level': 'io'},
fundchannel=False)
Expand Down Expand Up @@ -671,6 +673,16 @@ def test_gossip_query_channel_range(node_factory, bitcoind):
assert ret['short_channel_ids'][1] == scid23
l2.daemon.wait_for_log('queue_channel_ranges full: splitting')

# Test overflow case doesn't split forever; should only get 32 for this.
ret = l1.rpc.dev_query_channel_range(id=l2.info['id'],
first=1,
num=429496000)
l1.daemon.wait_for_logs([r'\[IN\] 0108'] * 32)

# And no more!
time.sleep(1)
assert not l1.daemon.is_in_log(r'\[IN\] 0108', start=l1.daemon.logsearch_start)

# This should actually be large enough for zlib to kick in!
l3.fund_channel(l4, 10**5)
bitcoind.generate_block(5)
Expand Down

0 comments on commit a4fe50c

Please sign in to comment.