merge bitcoin#30545: fix intermittent failures in feature_proxy.py

This commit is contained in:
Kittywhiskers Van Gogh 2024-07-29 15:36:55 -04:00
parent 7e2d435e35
commit 9072a10754
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -125,7 +125,8 @@ class ProxyTest(BitcoinTestFramework):
rv = [] rv = []
addr = "15.61.23.23:1234" addr = "15.61.23.23:1234"
self.log.debug(f"Test: outgoing IPv4 connection through node for address {addr}") self.log.debug(f"Test: outgoing IPv4 connection through node 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() cmd = proxies[0].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
# Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 # Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
@ -141,7 +142,7 @@ class ProxyTest(BitcoinTestFramework):
if self.have_ipv6: if self.have_ipv6:
addr = "[1233:3432:2434:2343:3234:2345:6546:4534]:5443" addr = "[1233:3432:2434:2343:3234:2345:6546:4534]:5443"
self.log.debug(f"Test: outgoing IPv6 connection through node for address {addr}") self.log.debug(f"Test: outgoing IPv6 connection through node for address {addr}")
node.addnode(addr, "onetry") node.addnode(addr, "onetry", v2transport=False)
cmd = proxies[1].queue.get() cmd = proxies[1].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
# Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 # Note: dashd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
@ -157,7 +158,7 @@ class ProxyTest(BitcoinTestFramework):
if test_onion: if test_onion:
addr = "pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion:8333" addr = "pg6mmjiyjmcrsslvykfwnntlaru7p5svn6y2ymmju6nubxndf4pscryd.onion:8333"
self.log.debug(f"Test: outgoing onion connection through node for address {addr}") self.log.debug(f"Test: outgoing onion connection through node for address {addr}")
node.addnode(addr, "onetry") node.addnode(addr, "onetry", v2transport=False)
cmd = proxies[2].queue.get() cmd = proxies[2].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.atyp, AddressType.DOMAINNAME)
@ -172,7 +173,7 @@ class ProxyTest(BitcoinTestFramework):
if test_cjdns: if test_cjdns:
addr = "[fc00:1:2:3:4:5:6:7]:8888" addr = "[fc00:1:2:3:4:5:6:7]:8888"
self.log.debug(f"Test: outgoing CJDNS connection through node for address {addr}") self.log.debug(f"Test: outgoing CJDNS connection through node for address {addr}")
node.addnode(addr, "onetry") node.addnode(addr, "onetry", v2transport=False)
cmd = proxies[1].queue.get() cmd = proxies[1].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.atyp, AddressType.DOMAINNAME)
@ -186,7 +187,7 @@ class ProxyTest(BitcoinTestFramework):
addr = "node.noumenon:8333" addr = "node.noumenon:8333"
self.log.debug(f"Test: outgoing DNS name connection through node for address {addr}") self.log.debug(f"Test: outgoing DNS name connection through node for address {addr}")
node.addnode(addr, "onetry") node.addnode(addr, "onetry", v2transport=False)
cmd = proxies[3].queue.get() cmd = proxies[3].queue.get()
assert isinstance(cmd, Socks5Command) assert isinstance(cmd, Socks5Command)
assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.atyp, AddressType.DOMAINNAME)