Skip to content

Commit

Permalink
[test] Clarify setup of node topology.
Browse files Browse the repository at this point in the history
Since the test framework automatically sets up a connection between the nodes,
the second connect_nodes call was a no-op. Remove the redundant call & add
comments to explain the expected topology.
  • Loading branch information
amitiuttarwar committed Oct 28, 2020
1 parent 0672522 commit 47ff509
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion test/functional/p2p_disconnect_ban.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ def set_test_params(self):

def run_test(self):
self.log.info("Connect nodes both way")
# By default, the test framework sets up an addnode connection from
# node 1 --> node0. By connecting node0 --> node 1, we're left with
# the two nodes being connected both ways.
# Topology will look like: node0 <--> node1
self.connect_nodes(0, 1)
self.connect_nodes(1, 0)

self.log.info("Test setban and listbanned RPCs")

Expand Down
7 changes: 5 additions & 2 deletions test/functional/rpc_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ def set_test_params(self):
def run_test(self):
# Get out of IBD for the minfeefilter and getpeerinfo tests.
self.nodes[0].generate(101)
# Connect nodes both ways.

# By default, the test framework sets up an addnode connection from
# node 1 --> node0. By connecting node0 --> node 1, we're left with
# the two nodes being connected both ways.
# Topology will look like: node0 <--> node1
self.connect_nodes(0, 1)
self.connect_nodes(1, 0)
self.sync_all()

self.test_connection_count()
Expand Down

0 comments on commit 47ff509

Please sign in to comment.