mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
pytest: make test_multirpc check that RPC commands complete.
This was hanging sometimes in travis, but actually checking the result
of the commands makes it *always* hang. We remove the waitinvoice
which will not return.
ZmnSCPxj points out that this behavior, introduced in
ce0bd7abd3, is a regression: it would be
nice to be able to cancel a waitinvoice. But that fix is more complex,
and will have to be another PR.
This test will now hang, but it's OK: we're about to fix it!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
9a0f3a764c
commit
fe11ee5406
@@ -605,12 +605,13 @@ def test_multirpc(node_factory):
|
|||||||
b'{"id":5,"jsonrpc":"2.0","method":"listpeers","params":[]}',
|
b'{"id":5,"jsonrpc":"2.0","method":"listpeers","params":[]}',
|
||||||
b'{"id":6,"jsonrpc":"2.0","method":"listpeers","params":[]}',
|
b'{"id":6,"jsonrpc":"2.0","method":"listpeers","params":[]}',
|
||||||
b'{"method": "invoice", "params": [100, "foo", "foo"], "jsonrpc": "2.0", "id": 7 }',
|
b'{"method": "invoice", "params": [100, "foo", "foo"], "jsonrpc": "2.0", "id": 7 }',
|
||||||
b'{"method": "waitinvoice", "params": ["foo"], "jsonrpc" : "2.0", "id": 8 }',
|
# FIXME: b'{"method": "waitinvoice", "params": ["foo"], "jsonrpc" : "2.0", "id": 8 }',
|
||||||
b'{"method": "delinvoice", "params": ["foo", "unpaid"], "jsonrpc" : "2.0", "id": 9 }',
|
b'{"method": "delinvoice", "params": ["foo", "unpaid"], "jsonrpc" : "2.0", "id": 9 }',
|
||||||
]
|
]
|
||||||
|
|
||||||
sock.sendall(b'\n'.join(commands))
|
sock.sendall(b'\n'.join(commands))
|
||||||
|
|
||||||
|
for i in commands:
|
||||||
l1.rpc._readobj(sock)
|
l1.rpc._readobj(sock)
|
||||||
sock.close()
|
sock.close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user