mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: allow more time for test_waitblockheight !DEVELOPER.
It actually timed out with the default 60 seconds, just before it
saw the block:
```
2022-06-07T02:16:05.2557049Z bitcoind.generate_block(1)
2022-06-07T02:16:05.2557300Z sync_blockheight(bitcoind, [node])
2022-06-07T02:16:05.2557594Z fut1.result(5)
2022-06-07T02:16:05.2557912Z assert not fut2.done()
2022-06-07T02:16:05.2558121Z
2022-06-07T02:16:05.2558370Z # Trigger two blocks.
2022-06-07T02:16:05.2558689Z bitcoind.generate_block(1)
2022-06-07T02:16:05.2558941Z sync_blockheight(bitcoind, [node])
2022-06-07T02:16:05.2559219Z > fut2.result(5)
2022-06-07T02:16:05.2559350Z
2022-06-07T02:16:05.2559508Z tests/test_misc.py:2138:
...
2022-06-07T02:16:05.2586947Z elif "error" in resp:
2022-06-07T02:16:05.2587398Z > raise RpcError(method, payload, resp['error'])
2022-06-07T02:16:05.2588026Z E pyln.client.lightning.RpcError: RPC call failed: method: waitblockheight, payload: {'blockheight': 103}, error: {'code': 2000, 'message': 'Timed out.'}
2022-06-07T02:16:05.2588325Z
2022-06-07T02:16:05.2588563Z contrib/pyln-client/pyln/client/lightning.py:387: RpcError
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -2135,9 +2135,16 @@ def test_waitblockheight(node_factory, executor, bitcoind):
|
||||
node.rpc.waitblockheight(blockheight - 1)
|
||||
node.rpc.waitblockheight(blockheight)
|
||||
|
||||
# Developer mode polls bitcoind every second, so 60 seconds is plenty.
|
||||
# But non-developer mode polls every 30 seconds, so try 120.
|
||||
if DEVELOPER:
|
||||
time = 60
|
||||
else:
|
||||
time = 120
|
||||
|
||||
# Should not succeed yet.
|
||||
fut2 = executor.submit(node.rpc.waitblockheight, blockheight + 2)
|
||||
fut1 = executor.submit(node.rpc.waitblockheight, blockheight + 1)
|
||||
fut2 = executor.submit(node.rpc.waitblockheight, blockheight + 2, time)
|
||||
fut1 = executor.submit(node.rpc.waitblockheight, blockheight + 1, time)
|
||||
assert not fut1.done()
|
||||
assert not fut2.done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user