diff options
author | merge-script <fanquake@gmail.com> | 2024-07-31 12:03:22 +0100 |
---|---|---|
committer | merge-script <fanquake@gmail.com> | 2024-07-31 12:03:22 +0100 |
commit | 33884e7e60c71604c2206498839aabdd92798dc5 (patch) | |
tree | 568336ea577fea0e9d6e0950e39e45914711409f /test | |
parent | be969292db72ddac32bbf101f0706e3665e059e2 (diff) | |
parent | a6efc7e16ed23377705a0a6a3445cab0acfd7ccc (diff) |
Merge bitcoin/bitcoin#30545: test: fix intermittent failures in feature_proxy.py
a6efc7e16ed23377705a0a6a3445cab0acfd7ccc test: fix intermittent failures in feature_proxy.py (Martin Zumsande)
Pull request description:
Fixes #29871
If addnode connections are made with v2transport and the peer immediately disconnects us, reconnections with v1 are scheduled. This could interfere with later checks depending on timing. Avoid this by using `v2transport=False` in the addnode rpc - this test isn't about the message layer anyway, so running it with v2 would add no value.
ACKs for top commit:
maflcko:
ACK a6efc7e16ed23377705a0a6a3445cab0acfd7ccc
tdb3:
cr re ACK a6efc7e16ed23377705a0a6a3445cab0acfd7ccc
Tree-SHA512: 39353a392e75e4c6257d971ceecb65fb76ec6d3b121a087869831c24b767a18f57e2ae2968da445c7fa731cb03053c90df37dd2cd6e86f786ad4121bc68ca235
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_proxy.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/functional/feature_proxy.py b/test/functional/feature_proxy.py index 2201821fda..644ee5cc7f 100755 --- a/test/functional/feature_proxy.py +++ b/test/functional/feature_proxy.py @@ -148,7 +148,8 @@ class ProxyTest(BitcoinTestFramework): rv = [] addr = "15.61.23.23:1234" self.log.debug(f"Test: outgoing IPv4 connection through node {node.index} for address {addr}") - node.addnode(addr, "onetry") + # v2transport=False is used to avoid reconnections with v1 being scheduled. These could interfere with later checks. + node.addnode(addr, "onetry", v2transport=False) cmd = proxies[0].queue.get() assert isinstance(cmd, Socks5Command) # Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 @@ -164,7 +165,7 @@ class ProxyTest(BitcoinTestFramework): if self.have_ipv6: addr = "[1233:3432:2434:2343:3234:2345:6546:4534]:5443" self.log.debug(f"Test: outgoing IPv6 connection through node {node.index} for address {addr}") - node.addnode(addr, "onetry") + node.addnode(addr, "onetry", v2transport=False) cmd = proxies[1].queue.get() assert isinstance(cmd, Socks5Command) # Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 @@ -180,7 +181,7 @@ class ProxyTest(BitcoinTestFramework): if test_onion: addr = "pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion:8333" self.log.debug(f"Test: outgoing onion connection through node {node.index} for address {addr}") - node.addnode(addr, "onetry") + node.addnode(addr, "onetry", v2transport=False) cmd = proxies[2].queue.get() assert isinstance(cmd, Socks5Command) assert_equal(cmd.atyp, AddressType.DOMAINNAME) @@ -195,7 +196,7 @@ class ProxyTest(BitcoinTestFramework): if test_cjdns: addr = "[fc00:1:2:3:4:5:6:7]:8888" self.log.debug(f"Test: outgoing CJDNS connection through node {node.index} for address {addr}") - node.addnode(addr, "onetry") + node.addnode(addr, "onetry", v2transport=False) cmd = proxies[1].queue.get() assert isinstance(cmd, Socks5Command) assert_equal(cmd.atyp, AddressType.DOMAINNAME) @@ -209,7 +210,7 @@ class ProxyTest(BitcoinTestFramework): addr = "node.noumenon:8333" self.log.debug(f"Test: outgoing DNS name connection through node {node.index} for address {addr}") - node.addnode(addr, "onetry") + node.addnode(addr, "onetry", v2transport=False) cmd = proxies[3].queue.get() assert isinstance(cmd, Socks5Command) assert_equal(cmd.atyp, AddressType.DOMAINNAME) |