Fix network.tcp_no_connect_excluded_peers test failure on MacOS (#2750)
This commit is contained in:
parent
6f0fbbff53
commit
5af4a2e613
3 changed files with 10 additions and 0 deletions
|
|
@ -1121,6 +1121,9 @@ TEST (network, tcp_no_connect_excluded_peers)
|
||||||
node0->network.excluded_peers.remove (endpoint1_tcp);
|
node0->network.excluded_peers.remove (endpoint1_tcp);
|
||||||
ASSERT_FALSE (node0->network.excluded_peers.check (endpoint1_tcp));
|
ASSERT_FALSE (node0->network.excluded_peers.check (endpoint1_tcp));
|
||||||
|
|
||||||
|
// Wait until there is a syn_cookie
|
||||||
|
ASSERT_TIMELY (5s, node1->network.syn_cookies.cookies_size () != 0);
|
||||||
|
|
||||||
// Manually cleanup previous attempt
|
// Manually cleanup previous attempt
|
||||||
node1->network.cleanup (std::chrono::steady_clock::now ());
|
node1->network.cleanup (std::chrono::steady_clock::now ());
|
||||||
node1->network.syn_cookies.purge (std::chrono::steady_clock::now ());
|
node1->network.syn_cookies.purge (std::chrono::steady_clock::now ());
|
||||||
|
|
|
||||||
|
|
@ -1007,6 +1007,12 @@ void nano::syn_cookies::purge (std::chrono::steady_clock::time_point const & cut
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t nano::syn_cookies::cookies_size ()
|
||||||
|
{
|
||||||
|
nano::lock_guard<std::mutex> lock (syn_cookie_mutex);
|
||||||
|
return cookies.size ();
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<nano::container_info_component> nano::collect_container_info (network & network, const std::string & name)
|
std::unique_ptr<nano::container_info_component> nano::collect_container_info (network & network, const std::string & name)
|
||||||
{
|
{
|
||||||
auto composite = std::make_unique<container_info_composite> (name);
|
auto composite = std::make_unique<container_info_composite> (name);
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ public:
|
||||||
// Also removes the syn cookie from the store if valid
|
// Also removes the syn cookie from the store if valid
|
||||||
bool validate (nano::endpoint const &, nano::account const &, nano::signature const &);
|
bool validate (nano::endpoint const &, nano::account const &, nano::signature const &);
|
||||||
std::unique_ptr<container_info_component> collect_container_info (std::string const &);
|
std::unique_ptr<container_info_component> collect_container_info (std::string const &);
|
||||||
|
size_t cookies_size ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class syn_cookie_info final
|
class syn_cookie_info final
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue