Skip to content

Commit 150cc8e

Browse files
committed
Merge bitcoin/bitcoin#27128: test: fix intermittent issue in p2p_disconnect_ban
1819564 test: fix intermittent issue in `p2p_disconnect_ban` (brunoerg) Pull request description: Fixes #26808 When `node0` calls `disconnectnode` to disconnect `node1`, we should check in `node1` if it worked, because for `node0` the informations in `getpeerinfo` may be updated before really completing the disconnection. ACKs for top commit: MarcoFalke: lgtm ACK 1819564 Tree-SHA512: 53a386fc38e2faa6f6da3536e76857ff4b6f55e2590d73fe857b3fe5d0f3ff92c5c7e4abd50ab4be250cb2106a4d14ad95d4809ea60c6e00ed3ac0e71255b0b0
2 parents 446c8f5 + 1819564 commit 150cc8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/p2p_disconnect_ban.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def run_test(self):
116116
self.log.info("disconnectnode: successfully disconnect node by address")
117117
address1 = self.nodes[0].getpeerinfo()[0]['addr']
118118
self.nodes[0].disconnectnode(address=address1)
119-
self.wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 1, timeout=10)
119+
self.wait_until(lambda: len(self.nodes[1].getpeerinfo()) == 1, timeout=10)
120120
assert not [node for node in self.nodes[0].getpeerinfo() if node['addr'] == address1]
121121

122122
self.log.info("disconnectnode: successfully reconnect node")
@@ -127,7 +127,7 @@ def run_test(self):
127127
self.log.info("disconnectnode: successfully disconnect node by node id")
128128
id1 = self.nodes[0].getpeerinfo()[0]['id']
129129
self.nodes[0].disconnectnode(nodeid=id1)
130-
self.wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 1, timeout=10)
130+
self.wait_until(lambda: len(self.nodes[1].getpeerinfo()) == 1, timeout=10)
131131
assert not [node for node in self.nodes[0].getpeerinfo() if node['id'] == id1]
132132

133133
if __name__ == '__main__':

0 commit comments

Comments
 (0)