aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-11-28 18:06:39 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-11-28 18:06:43 +0100
commit7ae86b3c6845873ca96650fc69beb4ae5285c801 (patch)
tree68022a06d9c763f1ea9e3b1e618a32450e2a47ee /test
parent854b36cfa2ef017567dcf1e7d0304107a8700f2b (diff)
parent3ebde2143aa98af213872b98b474d904e55056f7 (diff)
downloadbitcoin-7ae86b3c6845873ca96650fc69beb4ae5285c801.tar.xz
Merge #20522: [test] Fix sync issue in disconnect_p2ps
3ebde2143aa98af213872b98b474d904e55056f7 [test] Fix wait condition in disconnect_p2ps (Amiti Uttarwar) Pull request description: #19315 currently has a [test failure](https://cirrus-ci.com/task/4545582645641216) because of a race. `disconnect_p2ps` is intended to have a `wait_until` clause that prevents this race, but the conditional doesn't match since its comparing two different object types. `MY_SUBVERSION` is defined in messages.py as a byte string, but is compared to the value returned by the RPC. This PR simply converts types to ensure they match, which should prevent the race from occurring. HUGE PROPS TO jnewbery for discovering the issue 🔎 ACKs for top commit: jnewbery: ACK 3ebde2143aa98af213872b98b474d904e55056f7 glozow: Code review ACK https://github.com/bitcoin/bitcoin/pull/20522/commits/3ebde2143aa98af213872b98b474d904e55056f7 Tree-SHA512: ca096b80a3e4d757a645f38846d6dc89d6a3d35c3435513a72d278e305faddd4aff9e75a767941b51b2abbf59c82679bac1e9a0140d6f285efe3053e51bcc2a8
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/test_framework/test_node.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 046efe730e..0a5b7f551c 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -544,7 +544,7 @@ class TestNode():
def num_test_p2p_connections(self):
"""Return number of test framework p2p connections to the node."""
- return len([peer for peer in self.getpeerinfo() if peer['subver'] == MY_SUBVERSION])
+ return len([peer for peer in self.getpeerinfo() if peer['subver'] == MY_SUBVERSION.decode("utf-8")])
def disconnect_p2ps(self):
"""Close all p2p connections to the node."""