mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Added stress test variant that is as simple to run as ./stress
This commit is contained in:
parent
a31814e8b4
commit
5fcdd6f20b
23
dbms/tests/stress
Executable file
23
dbms/tests/stress
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# https://stackoverflow.com/questions/360201/how-do-i-kill-background-processes-jobs-when-my-shell-script-exits
|
||||
trap 'kill -9 $(jobs -p)' EXIT
|
||||
|
||||
function thread()
|
||||
{
|
||||
while true; do
|
||||
./clickhouse-test --order random 2>&1 | awk '{ printf "'$1' " }'
|
||||
done
|
||||
}
|
||||
|
||||
# https://stackoverflow.com/questions/9954794/execute-a-shell-function-with-timeout
|
||||
export -f thread;
|
||||
|
||||
NUM_THREADS=16
|
||||
TIMEOUT=300
|
||||
|
||||
for i in $(seq 1 $NUM_THREADS); do
|
||||
timeout $TIMEOUT bash -c "thread $i" 2> /dev/null &
|
||||
done
|
||||
|
||||
wait
|
Loading…
Reference in New Issue
Block a user