Current master:
0Running 194 test cases...
1test/net_tests.cpp:94: error in "caddrdb_read": check addrman1.size() == 3 failed
2test/net_tests.cpp:105: error in "caddrdb_read": check addrman2.size() == 3 failed
3
4*** 2 failures detected in test suite "Bitcoin Test Suite"
I extended a debugging:
0diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp
1index 6debf6a..64afbad 100644
2--- a/src/test/net_tests.cpp
3+++ b/src/test/net_tests.cpp
4@@ -57,6 +57,8 @@ CDataStream AddrmanToStream(CAddrManSerializationMock& addrman)
5 ssPeersIn << addrman;
6 std::string str = ssPeersIn.str();
7 vector<unsigned char> vchData(str.begin(), str.end());
8+ cerr << "DBG: vchData.size() = " << vchData.size();
9+ cerr << ", vchData = " << HexStr(vchData) << "\n";
10 return CDataStream(vchData, SER_DISK, CLIENT_VERSION);
11 }
12
13@@ -89,6 +91,10 @@ BOOST_AUTO_TEST_CASE(caddrdb_read)
14 exceptionThrown = true;
15 }
16
17+ if (addrman1.size() != 3)
18+ cerr << "addrman1.size() == " << addrman1.size() << "\n";
19+ if (exceptionThrown)
20+ cerr << "exceptionThrown!\n";
21 BOOST_CHECK(addrman1.size() == 3);
22 BOOST_CHECK(exceptionThrown == false);
23
24@@ -99,6 +105,8 @@ BOOST_AUTO_TEST_CASE(caddrdb_read)
25 CAddrDB adb;
26 BOOST_CHECK(addrman2.size() == 0);
27 adb.Read(addrman2, ssPeers2);
28+ if (addrman2.size() != 3)
29+ cerr << "addrman2.size() == " << addrman2.size();
30 BOOST_CHECK(addrman2.size() == 3);
31 }
And to reproduce the problem:
0for i in {1..100}; do ./test_bitcoin --run_test=net_tests || break ; done
It looks like the serialization of CAddrMan
is fragile…