Increase tcp_io_timeout for test TSAN/ASAN builds (#2019)

Fixing TSAN node.vote_replay test
This commit is contained in:
Sergey Kroshnin 2019-05-25 23:46:35 +03:00 committed by GitHub
commit 75052a6ef7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 9 deletions

View file

@ -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)
{
{

View file

@ -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 */

View file

@ -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 };