Trying to enable thread fuzzer in flaky check

This commit is contained in:
alesapin 2020-12-21 13:06:36 +03:00
parent 37fe66b761
commit 643739df6b
2 changed files with 17 additions and 1 deletions

View File

@ -12,12 +12,23 @@ dpkg -i package_folder/clickhouse-test_*.deb
# install test configs
/usr/share/clickhouse-test/config/install.sh
service clickhouse-server start && sleep 5
# For flaky check we also enable thread fuzzer
if [ "$NUM_TRIES" -gt "1" ]; then
export THREAD_FUZZER_CPU_TIME_PERIOD_US=1000
export THREAD_FUZZER_SLEEP_PROBABILITY=0.1
export THREAD_FUZZER_SLEEP_TIME_US=100000
# simpliest way to forward env variables to server
/usr/bin/clickhouse-server --config /etc/clickhouse-server/config.xml --daemon
sleep 5
else
service clickhouse-server start && sleep 5
fi
if grep -q -- "--use-skip-list" /usr/bin/clickhouse-test; then
SKIP_LIST_OPT="--use-skip-list"
fi
function run_tests()
{
# We can have several additional options so we path them as array because it's

View File

@ -10,6 +10,7 @@
#include <common/sleep.h>
#include <IO/ReadHelpers.h>
#include <common/logger_useful.h>
#include <Common/Exception.h>
#include <Common/thread_local_rng.h>
@ -102,6 +103,10 @@ void ThreadFuzzer::initConfiguration()
initFromEnv(sleep_probability, "THREAD_FUZZER_SLEEP_PROBABILITY");
initFromEnv(sleep_time_us, "THREAD_FUZZER_SLEEP_TIME_US");
LOG_DEBUG(&Poco::Logger::get("ThreadFuzzer"), "Sleep probability {}", sleep_probability);
LOG_DEBUG(&Poco::Logger::get("ThreadFuzzer"), "Cpu time period {}", cpu_time_period_us);
LOG_DEBUG(&Poco::Logger::get("ThreadFuzzer"), "Sleep time us {}", sleep_time_us);
#if THREAD_FUZZER_WRAP_PTHREAD
# define INIT_WRAPPER_PARAMS(RET, NAME, ...) \
initFromEnv(NAME##_before_yield_probability, "THREAD_FUZZER_" #NAME "_BEFORE_YIELD_PROBABILITY"); \