core-lightning/tests
Rusty Russell 4b9537730b pytest: fix flake in test_routing_gossip.
If we mine too fast, gossip can reach a node which considers it too far in the guture.  Break it up.

```
    @pytest.mark.developer("Too slow without --dev-fast-gossip")
    def test_routing_gossip(node_factory, bitcoind):
        nodes = node_factory.get_nodes(5)
    
        for i in range(len(nodes) - 1):
            src, dst = nodes[i], nodes[i + 1]
            src.rpc.connect(dst.info['id'], 'localhost', dst.port)
            src.openchannel(dst, CHANNEL_SIZE, confirm=False, wait_for_announce=False)
    
        # openchannel calls fundwallet which mines a block; so first channel
        # is 4 deep, last is unconfirmed.
    
        # Allow announce messages.
        mine_funding_to_announce(bitcoind, nodes, num_blocks=6, wait_for_mempool=1)
    
        # Deep check that all channels are in there
        comb = []
        for i in range(len(nodes) - 1):
            comb.append((nodes[i].info['id'], nodes[i + 1].info['id']))
            comb.append((nodes[i + 1].info['id'], nodes[i].info['id']))
    
        def check_gossip(n):
            seen = []
            channels = n.rpc.listchannels()['channels']
            for c in channels:
                seen.append((c['source'], c['destination']))
            missing = set(comb) - set(seen)
            logging.debug("Node {id} is missing channels {chans}".format(
                id=n.info['id'],
                chans=missing)
            )
            return len(missing) == 0
    
        for n in nodes:
>           wait_for(lambda: check_gossip(n))

tests/test_gossip.py:721: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

success = <function test_routing_gossip.<locals>.<lambda> at 0x7f3200534ef0>
timeout = 180

    def wait_for(success, timeout=TIMEOUT):
        start_time = time.time()
        interval = 0.25
        while not success():
            time_left = start_time + timeout - time.time()
            if time_left <= 0:
>               raise ValueError("Timeout while waiting for {}".format(success))
E               ValueError: Timeout while waiting for <function test_routing_gossip.<locals>.<lambda> at 0x7f3200534ef0>
2023-07-10 13:37:22 +02:00
..
data pytest: add blackbox tests for reckless 2023-04-09 12:41:11 +09:30
fuzz fuzz: initial sha256 seeds 2023-07-10 14:56:50 +09:30
plugins plugins: update for new deprecation API where all fields are nicely wrapped. 2023-07-10 14:51:11 +09:30
vectors pytest: Remove onion test vectors containing legacy onions. 2022-03-18 09:20:11 +10:30
benchmark.py pytest: always provide payment_secret when making payments. 2021-07-14 14:38:00 -05:00
conftest.py tests: add marker for v1/v2 channel opens 2021-05-12 11:25:41 +09:30
db.py test-db-provider: if postgres in tests, startup a bookkeeper db 2022-07-28 12:08:18 +09:30
fixtures.py pyln.testing: remove Throttler. 2023-04-06 09:10:53 +09:30
rkls_github_canned_server.py pytest: add blackbox tests for reckless 2023-04-09 12:41:11 +09:30
test_bookkeeper.py pytest: make dual-funding tests using option_anchors_zero_fee_htlc_tx. 2023-06-29 11:28:47 -04:00
test_cln_rs.py pyln: Create a dedicated pyln-grpc-proto package 2023-07-10 13:47:38 +09:30
test_closing.py pytest: fix flake in test_onchain_middleman_simple with anchors. 2023-07-09 16:49:48 +09:30
test_connection.py multifundchannel: use excess_as_change flag to simplify logic. 2023-06-29 11:28:47 -04:00
test_db.py wallet: fix up PSBTs as a migration. 2023-03-31 09:16:25 +10:30
test_gossip.py pytest: fix flake in test_routing_gossip. 2023-07-10 13:37:22 +02:00
test_invoices.py pay: don't require description for hashdesc invoices (i.e. undeprecate). 2023-06-22 13:23:21 +09:30
test_misc.py pytest: adapt all the anchor-iff-EXPERIMENTAL tests to --experimental-anchors. 2023-06-29 11:28:47 -04:00
test_mkfunding.py pytest: add tests for devtools/mkfunding 2023-01-09 14:50:30 -06:00
test_onion.py lightningd: remove support for legacy onion format. 2022-03-18 09:20:11 +10:30
test_opening.py pytest: test for emergency minimum fund violations. 2023-06-29 11:28:47 -04:00
test_pay.py pytest: adapt all the anchor-iff-EXPERIMENTAL tests to --experimental-anchors. 2023-06-29 11:28:47 -04:00
test_plugin.py pytest: fix reconnect flake in test_plugin_connected_hook_chaining 2023-06-23 14:36:23 +09:30
test_reckless.py pytest: ignore pip warning 2023-04-24 13:08:15 -07:00
test_wallet.py test_withdraw_bech32m: test that expected outputs exist for bech32(m) withdrawals 2023-05-25 11:07:45 +09:30
utils.py pytest: adapt all the anchor-iff-EXPERIMENTAL tests to --experimental-anchors. 2023-06-29 11:28:47 -04:00
valgrind-suppressions.txt pytest: Use valgrind target suppressions instead of skipping tests 2022-03-10 10:21:41 +10:30