diff --git a/debian/clickhouse-server.init b/debian/clickhouse-server.init index 3c5b6edc05d..b82c70bd6e0 100755 --- a/debian/clickhouse-server.init +++ b/debian/clickhouse-server.init @@ -76,7 +76,7 @@ is_supported_command() is_running() { - [ -r "$CLICKHOUSE_PIDFILE" ] && pgrep -s $(cat "$CLICKHOUSE_PIDFILE") 1> /dev/null 2> /dev/null + pgrep --pidfile "$CLICKHOUSE_PIDFILE" $(echo "${PROGRAM}" | cut -c1-15) 1> /dev/null 2> /dev/null } diff --git a/docker/test/stress/run.sh b/docker/test/stress/run.sh index 793191b08da..47c8603babb 100755 --- a/docker/test/stress/run.sh +++ b/docker/test/stress/run.sh @@ -8,7 +8,19 @@ dpkg -i package_folder/clickhouse-server_*.deb dpkg -i package_folder/clickhouse-client_*.deb dpkg -i package_folder/clickhouse-test_*.deb -function wait_server() +function stop() +{ + timeout 120 service clickhouse-server stop + + # Wait for process to disappear from processlist and also try to kill zombies. + while kill -9 $(pidof clickhouse-server) + do + echo "Killed clickhouse-server" + sleep 0.5 + done +} + +function start() { counter=0 until clickhouse-client --query "SELECT 1" @@ -18,9 +30,10 @@ function wait_server() echo "Cannot start clickhouse-server" cat /var/log/clickhouse-server/stdout.log tail -n1000 /var/log/clickhouse-server/stderr.log - tail -n1000 /var/log/clickhouse-server/clickhouse-server.err.log + tail -n1000 /var/log/clickhouse-server/clickhouse-server.log break fi + timeout 120 service clickhouse-server start sleep 0.5 counter=$(($counter + 1)) done @@ -34,19 +47,15 @@ echo "TSAN_OPTIONS='halt_on_error=1 history_size=7 ignore_noninstrumented_module echo "UBSAN_OPTIONS='print_stacktrace=1'" >> /etc/environment echo "ASAN_OPTIONS='malloc_context_size=10 verbosity=1 allocator_release_to_os_interval_ms=10000'" >> /etc/environment -timeout 120 service clickhouse-server start - -wait_server +start /s3downloader --dataset-names $DATASETS chmod 777 -R /var/lib/clickhouse clickhouse-client --query "ATTACH DATABASE IF NOT EXISTS datasets ENGINE = Ordinary" clickhouse-client --query "CREATE DATABASE IF NOT EXISTS test" -timeout 120 service clickhouse-server stop -timeout 120 service clickhouse-server start - -wait_server +stop +start clickhouse-client --query "SHOW TABLES FROM datasets" clickhouse-client --query "SHOW TABLES FROM test" @@ -56,9 +65,7 @@ clickhouse-client --query "SHOW TABLES FROM test" ./stress --output-folder test_output --skip-func-tests "$SKIP_TESTS_OPTION" -timeout 120 service clickhouse-server stop -timeout 120 service clickhouse-server start - -wait_server +stop +start clickhouse-client --query "SELECT 'Server successfuly started'" > /test_output/alive_check.txt || echo 'Server failed to start' > /test_output/alive_check.txt diff --git a/tests/performance/linear_regression.xml b/tests/performance/linear_regression.xml index a23924939a2..b60e890c5d9 100644 --- a/tests/performance/linear_regression.xml +++ b/tests/performance/linear_regression.xml @@ -1,12 +1,9 @@ - - test.hits hits_100m_single - DROP TABLE IF EXISTS test_model CREATE TABLE test_model engine = Memory as select stochasticLinearRegressionState(0.0001)(Age, Income, ParamPrice, Robotness, RefererHash) as state from test.hits