mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
pytest: fix port allocation race when nodes restart.
We use ephemeral_port_reserve to grab ports, but this can fail when we restart a node, since the port can be reallocated at that point. Attempt to overcome this using a global reserved list (is there a neater way?). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -2104,7 +2104,7 @@ def test_unix_socket_path_length(node_factory, bitcoind, directory, executor, db
|
||||
os.makedirs(lightning_dir)
|
||||
db = db_provider.get_db(lightning_dir, "test_unix_socket_path_length", 1)
|
||||
|
||||
l1 = LightningNode(1, lightning_dir, bitcoind, executor, VALGRIND, db=db, port=node_factory.get_next_port())
|
||||
l1 = LightningNode(1, lightning_dir, bitcoind, executor, VALGRIND, db=db, port=reserve())
|
||||
|
||||
# `LightningNode.start()` internally calls `LightningRpc.getinfo()` which
|
||||
# exercises the socket logic, and raises an issue if it fails.
|
||||
|
||||
Reference in New Issue
Block a user