diff --git a/nano/core_test/network.cpp b/nano/core_test/network.cpp index 5f786efb..49a0a5d6 100644 --- a/nano/core_test/network.cpp +++ b/nano/core_test/network.cpp @@ -2157,7 +2157,7 @@ TEST (bootstrap, tcp_listener_timeout_node_id_handshake) ASSERT_EQ (node0->bootstrap.connections.size (), 1); } bool disconnected (false); - system.deadline_set (std::chrono::seconds (10)); + system.deadline_set (std::chrono::seconds (20)); while (!disconnected) { { diff --git a/nano/lib/config.hpp b/nano/lib/config.hpp index 13b834c3..7a3ee110 100644 --- a/nano/lib/config.hpp +++ b/nano/lib/config.hpp @@ -17,6 +17,16 @@ */ static const char * NANO_MAJOR_MINOR_VERSION = xstr (NANO_VERSION_MAJOR) "." xstr (NANO_VERSION_MINOR); static const char * NANO_MAJOR_MINOR_RC_VERSION = xstr (NANO_VERSION_MAJOR) "." xstr (NANO_VERSION_MINOR) "RC" xstr (NANO_VERSION_PATCH); +/** Is TSAN/ASAN test build */ +#if defined(__has_feature) +#if __has_feature(thread_sanitizer) || __has_feature(address_sanitizer) +static const bool is_sanitizer_build = true; +#else +static const bool is_sanitizer_build = false; +#endif +#else +static const bool is_sanitizer_build = false; +#endif namespace nano { @@ -57,13 +67,7 @@ public: default_rpc_port = is_live_network () ? 7076 : is_beta_network () ? 55000 : 45000; default_ipc_port = is_live_network () ? 7077 : is_beta_network () ? 56000 : 46000; default_websocket_port = is_live_network () ? 7078 : is_beta_network () ? 57000 : 47000; - request_interval_ms = is_test_network () ? 20 : 16000; - // Increase interval for test TSAN/ASAN builds -#if defined(__has_feature) -#if __has_feature(thread_sanitizer) || __has_feature(address_sanitizer) - request_interval_ms = is_test_network () ? 100 : 16000; -#endif -#endif + request_interval_ms = is_test_network () ? (is_sanitizer_build ? 100 : 20) : 16000; } /** The network this param object represents. This may differ from the global active network; this is needed for certain --debug... commands */ diff --git a/nano/node/nodeconfig.hpp b/nano/node/nodeconfig.hpp index 518811ce..0155f24d 100644 --- a/nano/node/nodeconfig.hpp +++ b/nano/node/nodeconfig.hpp @@ -63,7 +63,7 @@ public: std::chrono::milliseconds block_processor_batch_max_time{ std::chrono::milliseconds (5000) }; std::chrono::seconds unchecked_cutoff_time{ std::chrono::seconds (4 * 60 * 60) }; // 4 hours /** Timeout for initiated async operations */ - std::chrono::seconds tcp_io_timeout{ network_params.network.is_test_network () ? std::chrono::seconds (5) : std::chrono::seconds (15) }; + std::chrono::seconds tcp_io_timeout{ (network_params.network.is_test_network () && !is_sanitizer_build) ? std::chrono::seconds (5) : std::chrono::seconds (15) }; std::chrono::nanoseconds pow_sleep_interval{ 0 }; /** Default maximum incoming TCP connections, including realtime network & bootstrap */ unsigned tcp_incoming_connections_max{ 1024 };