intermittent unit test failure: test/net_tests.cpp(311): error: in “net_tests/cnetaddr_basic”: check addr_str == scoped_addr || addr_str == “fe80:0:0:0:0:0:0:1” has failed #21682
issue MarcoFalke openend this issue on April 14, 2021-
MarcoFalke commented at 5:55 pm on April 14, 2021: member
-
MarcoFalke added the label Bug on Apr 14, 2021
-
jonatack commented at 6:23 pm on April 14, 2021: memberThanks. Was about to push a fix after @ryanofsky reported on it lately.
-
jonatack commented at 6:24 pm on April 14, 2021: member
-
practicalswift commented at 10:45 pm on April 14, 2021: contributor
I’ve looked at that test before and I don’t think that specific
BOOST_CHECK
makes much sense TBH :)1.) I don’t understand why we test if
ToString()
output includes%zone_index
: it clearly doesn’t on some platforms, so we cannot rely on it anyways. Then why test it?2.) And perhaps more fundamentally: why would we even want to have
%zone_index
in our textualToString()
output? I think the expectation is to get sayfe80::1ff:fe23:4567:890a
(without zone index) and not sayfe80::1ff:fe23:4567:890a%eth2
orfe80::1ff:fe23:4567:890a%3
when doingipv6_addr.ToString()
:)Suggested solution:
0diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp 1index 8eab26f3d..61cb381aa 100644 2--- a/src/test/net_tests.cpp 3+++ b/src/test/net_tests.cpp 4@@ -307,10 +307,6 @@ BOOST_AUTO_TEST_CASE(cnetaddr_basic) 5 BOOST_REQUIRE(addr.IsValid()); 6 BOOST_REQUIRE(addr.IsIPv6()); 7 BOOST_CHECK(!addr.IsBindAny()); 8- const std::string addr_str{addr.ToString()}; 9- BOOST_CHECK(addr_str == scoped_addr || addr_str == "fe80:0:0:0:0:0:0:1"); 10- // The fallback case "fe80:0:0:0:0:0:0:1" is needed for macOS 10.14/10.15 and (probably) later. 11 // Test that the delimiter "%" and default zone id of 0 can be omitted for the default scope. 12 BOOST_REQUIRE(LookupHost(link_local + "%0", addr, false)); 13 BOOST_REQUIRE(addr.IsValid()); 14 BOOST_REQUIRE(addr.IsIPv6());
:)
-
MarcoFalke added this to the milestone 22.0 on Apr 15, 2021
-
MarcoFalke closed this on Apr 17, 2021
-
jonatack commented at 10:19 am on April 17, 2021: memberNoting here that this was also fixed by #21690 as I wrote above in #21682 (comment) that I would do. #21690 not only fixed the issue but also kept the test coverage and improved the contextual information to avoid the confusion above and that I think was worth keeping.
-
sidhujag referenced this in commit 94b99db6d3 on Apr 17, 2021
-
PastaPastaPasta referenced this in commit 437ecceadc on Jun 27, 2021
-
PastaPastaPasta referenced this in commit 7d6d33b123 on Jun 28, 2021
-
PastaPastaPasta referenced this in commit 45711c5738 on Jun 29, 2021
-
DrahtBot locked this on Aug 18, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-04-12 00:13 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-04-12 00:13 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me