From 95ad45a3b00ea7106478def2e076b075216a22ce Mon Sep 17 00:00:00 2001 From: Alexander Tokmakov Date: Thu, 15 Oct 2020 21:14:04 +0300 Subject: [PATCH] minor improvements of stress test --- docker/test/stress/stress | 9 +++++++++ src/Common/Exception.cpp | 9 +++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docker/test/stress/stress b/docker/test/stress/stress index a81391d56a7..11fc63352d3 100755 --- a/docker/test/stress/stress +++ b/docker/test/stress/stress @@ -30,6 +30,15 @@ def get_options(i): options += " --order=random" if i % 2 == 1: options += " --db-engine=Ordinary" + + # If database name is not specified, new database is created for each functional test. + # Run some threads with one database for all tests. + if i % 3 == 1: + options += " --database=test_{}".format(i) + + if i == 13: + options += " --client-option='memory_tracker_fault_probability=0.00001'" + return options diff --git a/src/Common/Exception.cpp b/src/Common/Exception.cpp index 4dbd685d562..5a19c3b2e9c 100644 --- a/src/Common/Exception.cpp +++ b/src/Common/Exception.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -36,13 +37,13 @@ namespace ErrorCodes Exception::Exception(const std::string & msg, int code) : Poco::Exception(msg, code) { - // In debug builds, treat LOGICAL_ERROR as an assertion failure. + // In debug builds and builds with sanitizers, treat LOGICAL_ERROR as an assertion failure. // Log the message before we fail. -#ifndef NDEBUG +#if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || defined(MEMORY_SANITIZER) || defined(UNDEFINED_BEHAVIOR_SANITIZER) if (code == ErrorCodes::LOGICAL_ERROR) { - LOG_ERROR(&Poco::Logger::root(), "Logical error: '{}'.", msg); - assert(false); + LOG_FATAL(&Poco::Logger::root(), "Logical error: '{}'.", msg); + abort(); } #endif }