mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
fixup: test_multirpc does not terminate.
We need to set expiry, otherwise waitinvoice would take 1 hr, and we can't read once for every cmd, since each read may consume more than a single result, and we block. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
cab7e3e43a
commit
c8f9ea7bf7
@@ -3422,17 +3422,14 @@ class LightningDTests(BaseLightningDTests):
|
|||||||
b'{"id":4,"jsonrpc":"2.0","method":"listpeers","params":[]}',
|
b'{"id":4,"jsonrpc":"2.0","method":"listpeers","params":[]}',
|
||||||
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", 1], "jsonrpc": "2.0", "id": 7 }',
|
||||||
b'{"method": "waitinvoice", "params": ["foo"], "jsonrpc" : "2.0", "id": 8 }',
|
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))
|
||||||
|
|
||||||
# We only care to get back enough results, not their content
|
|
||||||
for _ in commands:
|
|
||||||
l1.rpc._readobj(sock)
|
l1.rpc._readobj(sock)
|
||||||
#time.sleep(1)
|
|
||||||
sock.close()
|
sock.close()
|
||||||
|
|
||||||
def test_cli(self):
|
def test_cli(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user