mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Merge bitcoin/bitcoin#27506: test: prevent intermittent failures
10a354f1740a5c1b913d0b6951e80fb5401ab43a test: prevent intermittent failures (Amiti Uttarwar) Pull request description: Follow up to #27214 - add an address to the tried table before the new table to make sure a new table collision is not possible. ACKs for top commit: mzumsande: Code review ACK 10a354f1740a5c1b913d0b6951e80fb5401ab43a - the fix is what I suggested [here](https://github.com/bitcoin/bitcoin/pull/27214#discussion_r1169169601) and should make these intermittent failures impossible. Tree-SHA512: 24099f02e1915395130065af0ef6a2a1893955d222517d156d928765541d9c427da00172a9b5a540163f4d6aae93ca3882e8267eeb35ecc595d42178abc6191c
This commit is contained in:
parent
9b58b2d97b
commit
df7be026e4
@ -258,10 +258,7 @@ BOOST_AUTO_TEST_CASE(addrman_select_special)
|
|||||||
// use a non-deterministic addrman to ensure a passing test isn't due to setup
|
// use a non-deterministic addrman to ensure a passing test isn't due to setup
|
||||||
auto addrman = std::make_unique<AddrMan>(EMPTY_NETGROUPMAN, /*deterministic=*/false, GetCheckRatio(m_node));
|
auto addrman = std::make_unique<AddrMan>(EMPTY_NETGROUPMAN, /*deterministic=*/false, GetCheckRatio(m_node));
|
||||||
|
|
||||||
// add ipv4 address to the new table
|
|
||||||
CNetAddr source = ResolveIP("252.2.2.2");
|
CNetAddr source = ResolveIP("252.2.2.2");
|
||||||
CService addr1 = ResolveService("250.1.1.3", 8333);
|
|
||||||
BOOST_CHECK(addrman->Add({CAddress(addr1, NODE_NONE)}, source));
|
|
||||||
|
|
||||||
// add I2P address to the tried table
|
// add I2P address to the tried table
|
||||||
CAddress i2p_addr;
|
CAddress i2p_addr;
|
||||||
@ -269,6 +266,10 @@ BOOST_AUTO_TEST_CASE(addrman_select_special)
|
|||||||
BOOST_CHECK(addrman->Add({i2p_addr}, source));
|
BOOST_CHECK(addrman->Add({i2p_addr}, source));
|
||||||
BOOST_CHECK(addrman->Good(i2p_addr));
|
BOOST_CHECK(addrman->Good(i2p_addr));
|
||||||
|
|
||||||
|
// add ipv4 address to the new table
|
||||||
|
CService addr1 = ResolveService("250.1.1.3", 8333);
|
||||||
|
BOOST_CHECK(addrman->Add({CAddress(addr1, NODE_NONE)}, source));
|
||||||
|
|
||||||
// since the only ipv4 address is on the new table, ensure that the new
|
// since the only ipv4 address is on the new table, ensure that the new
|
||||||
// table gets selected even if new_only is false. if the table was being
|
// table gets selected even if new_only is false. if the table was being
|
||||||
// selected at random, this test will sporadically fail
|
// selected at random, this test will sporadically fail
|
||||||
|
Loading…
Reference in New Issue
Block a user