Skip to content

Commit

Permalink
tests: use wait_until in get_mininode_id
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Jan 28, 2021
1 parent be7c66d commit 4bcd660
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/functional/p2p_quorum_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,16 @@ def p2p_connection(node, uacomment=None):


def get_mininode_id(node, uacomment=None):
tries = 0
node_id = None
while tries < 200 and node_id is None:
def get_id():
for p in node.getpeerinfo():
for p2p in node.p2ps:
if uacomment is not None and p2p.uacomment != uacomment:
continue
if p["subver"] == p2p.strSubVer.decode():
node_id = p["id"]
break
tries += 1
time.sleep(0.05)
assert node_id is not None
return node_id
return p["id"]
return None
wait_until(lambda: get_id() != None, timeout=10)
return get_id()


def mnauth(node, node_id, protx_hash, operator_pubkey):
Expand Down

0 comments on commit 4bcd660

Please sign in to comment.