Skip to content

Commit

Permalink
In disconnect_p2ps(), wait for p2p connections to disappear from getp…
Browse files Browse the repository at this point in the history
…eerinfo()
  • Loading branch information
codablock committed Apr 17, 2020
1 parent 76d7b17 commit 3054854
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import time

from .authproxy import JSONRPCException
from .messages import MY_SUBVERSION
from .util import (
assert_equal,
delete_cookie_file,
Expand Down Expand Up @@ -223,6 +224,14 @@ def disconnect_p2ps(self):
p.peer_disconnect()
del self.p2ps[:]

# wait for p2p connections to disappear from getpeerinfo()
def check_peers():
for p in self.getpeerinfo():
if p['subver'] == MY_SUBVERSION.decode():
return False
return True
wait_until(check_peers, timeout=5)

class TestNodeCLIAttr:
def __init__(self, cli, command):
self.cli = cli
Expand Down

0 comments on commit 3054854

Please sign in to comment.