mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: clean up test_gossip_notices_close now that gossipwith has more options.
And drive-by fix: document that you can now (since
e40f07803c) use --max-messages=0.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -221,7 +221,7 @@ int main(int argc, char *argv[])
|
|||||||
"Stream complete gossip history at start");
|
"Stream complete gossip history at start");
|
||||||
opt_register_arg("--max-messages", opt_set_ulongval, opt_show_ulongval,
|
opt_register_arg("--max-messages", opt_set_ulongval, opt_show_ulongval,
|
||||||
&max_messages,
|
&max_messages,
|
||||||
"Terminate after reading this many messages (> 0)");
|
"Terminate after reading this many messages");
|
||||||
opt_register_noarg("--stdin", opt_set_bool, &stream_stdin,
|
opt_register_noarg("--stdin", opt_set_bool, &stream_stdin,
|
||||||
"Stream gossip messages from stdin.");
|
"Stream gossip messages from stdin.");
|
||||||
opt_register_noarg("--no-init", opt_set_bool, &no_init,
|
opt_register_noarg("--no-init", opt_set_bool, &no_init,
|
||||||
|
|||||||
@@ -1123,17 +1123,13 @@ def test_gossip_notices_close(node_factory, bitcoind):
|
|||||||
wait_for(lambda: l1.rpc.listchannels()['channels'] == [])
|
wait_for(lambda: l1.rpc.listchannels()['channels'] == [])
|
||||||
wait_for(lambda: l1.rpc.listnodes()['nodes'] == [])
|
wait_for(lambda: l1.rpc.listnodes()['nodes'] == [])
|
||||||
|
|
||||||
# FIXME: This is a hack: we should have a framework for canned conversations
|
|
||||||
# This doesn't naturally terminate, so we give it 5 seconds.
|
|
||||||
try:
|
|
||||||
subprocess.run(['devtools/gossipwith',
|
subprocess.run(['devtools/gossipwith',
|
||||||
|
'--max-messages=0',
|
||||||
'{}@localhost:{}'.format(l1.info['id'], l1.port),
|
'{}@localhost:{}'.format(l1.info['id'], l1.port),
|
||||||
channel_announcement,
|
channel_announcement,
|
||||||
channel_update,
|
channel_update,
|
||||||
node_announcement],
|
node_announcement],
|
||||||
timeout=5, stdout=subprocess.PIPE)
|
timeout=TIMEOUT)
|
||||||
except subprocess.TimeoutExpired:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# l1 should reject it.
|
# l1 should reject it.
|
||||||
assert(l1.rpc.listchannels()['channels'] == [])
|
assert(l1.rpc.listchannels()['channels'] == [])
|
||||||
|
|||||||
Reference in New Issue
Block a user