ClickHouse/tests/queries/0_stateless/01526_client_start_and_exit.sh

29 lines
997 B
Bash
Raw Normal View History

2020-10-16 00:07:56 +00:00
#!/usr/bin/env bash
2021-09-12 12:35:27 +00:00
# Tags: no-fasttest
2020-10-16 00:07:56 +00:00
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2020-12-28 11:46:53 +00:00
# shellcheck source=../shell_config.sh
2020-10-16 00:07:56 +00:00
. "$CURDIR"/../shell_config.sh
# Create a huge amount of tables, so Suggest will take a time to load
2020-10-25 02:31:58 +00:00
${CLICKHOUSE_CLIENT} -q "SELECT 'CREATE TABLE test_' || hex(randomPrintableASCII(40)) || '(x UInt8) Engine=Memory;' FROM numbers(10000)" --format=TSVRaw | ${CLICKHOUSE_BENCHMARK} -c32 -i 10000 -d 0 2>&1 | grep -F 'Loaded 10000 queries'
2020-10-16 00:07:56 +00:00
function stress()
{
# 2004l is ignored because parallel running expect emulated terminal doesn't
# work well with bracketed paste enabling sequence, which is \e033?2004l
# (https://cirw.in/blog/bracketed-paste)
2020-10-16 00:07:56 +00:00
while true; do
"${CURDIR}"/01526_client_start_and_exit.expect-not-a-test-case | grep -v -P 'ClickHouse client|Connecting|Connected|:\) Bye\.|new year|^\s*$|spawn bash|\?2004l|^0\s*$'
2020-10-16 00:07:56 +00:00
done
}
2020-10-28 01:24:30 +00:00
export CURDIR
2020-10-16 00:07:56 +00:00
export -f stress
for _ in {1..10}; do
timeout 3 bash -c stress &
done
wait