Skip to content

Commit b637bd3

Browse files
committed
test: wait for ln nodes to be ready
1 parent b4f244f commit b637bd3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/ln_basic_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ def setup_network(self):
2929
self.log.info(self.warnet(f"deploy {self.network_dir}"))
3030
self.wait_for_all_tanks_status(target="running")
3131

32+
def wait_for_all_ln_rpc():
33+
nodes = ["tank-0000-lnd", "tank-0001-lnd", "tank-0002-lnd"]
34+
for node in nodes:
35+
try:
36+
self.warnet(f"ln rpc {node} getinfo")
37+
except Exception as e:
38+
print(f"LN node {node} not ready for rpc yet: {e}")
39+
return False
40+
return True
41+
42+
self.wait_for_predicate(wait_for_all_ln_rpc)
43+
3244
def fund_wallets(self):
3345
self.warnet("bitcoin rpc tank-0000 createwallet miner")
3446
self.warnet("bitcoin rpc tank-0000 -generate 110")

0 commit comments

Comments
 (0)