Commit 6abacaf6 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4382] better signal handling, update/rebuild once per day


git-svn-id: file:///svn/toku/tokudb@38718 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2ee1bacb
...@@ -35,6 +35,8 @@ EOF ...@@ -35,6 +35,8 @@ EOF
set -e set -e
. /opt/intel/bin/compilervars.sh intel64
scriptname=$(basename "$0") scriptname=$(basename "$0")
toku_toplevel=$(dirname $(dirname $(readlink -f "$PWD/$0"))) toku_toplevel=$(dirname $(dirname $(readlink -f "$PWD/$0")))
log=/tmp/run.stress-tests.log log=/tmp/run.stress-tests.log
...@@ -83,7 +85,7 @@ save_failure() { ...@@ -83,7 +85,7 @@ save_failure() {
num_ptquery=$1; shift num_ptquery=$1; shift
num_update=$1; shift num_update=$1; shift
phase=$1; shift phase=$1; shift
dest="${dir}/${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-${phase}-$$" dest="${dir}/${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-${phase}-${BASHPID}"
mkdir -p "$dest" mkdir -p "$dest"
mv $out "${dest}/output.txt" mv $out "${dest}/output.txt"
mv core* "${dest}/" mv core* "${dest}/"
...@@ -106,7 +108,7 @@ run_test() { ...@@ -106,7 +108,7 @@ run_test() {
t0="$(date)" t0="$(date)"
t1="" t1=""
t2="" t2=""
envdir="../${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-$$.dir" envdir="../${exec}-${table_size}-${cachetable_size}-${num_ptquery}-${num_update}-${BASHPID}.dir"
cd $rundir cd $rundir
if ! LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \ if ! LD_LIBRARY_PATH=../../../lib:$LD_LIBRARY_PATH \
../$exec -v --test --num_seconds 180 --envdir "$envdir" \ ../$exec -v --test --num_seconds 180 --envdir "$envdir" \
...@@ -137,6 +139,8 @@ run_test() { ...@@ -137,6 +139,8 @@ run_test() {
rm -rf $rundir "$envdir" rm -rf $rundir "$envdir"
} }
running=no
loop_test() { loop_test() {
exec="$1"; shift exec="$1"; shift
table_size="$1"; shift table_size="$1"; shift
...@@ -146,7 +150,7 @@ loop_test() { ...@@ -146,7 +150,7 @@ loop_test() {
ptquery_rand=0 ptquery_rand=0
update_rand=0 update_rand=0
while true while [[ $running = "yes" ]]
do do
num_ptquery=1 num_ptquery=1
num_update=1 num_update=1
...@@ -164,41 +168,40 @@ loop_test() { ...@@ -164,41 +168,40 @@ loop_test() {
done done
} }
cd $src_tests declare -a pids=(0)
for exec in ${testnames[@]}
do
if [[ ! -x $exec ]]
then
echo "Please build $exec" 1>&2
exit 1
fi
done
mkdir -p $log
mkdir -p $savedir
declare -a pids
i=0 i=0
savepid() { savepid() {
pids[i]=$1 pids[$i]=$1
(( i = i + 1 )) (( i = i + 1 ))
} }
killchildren() { killchildren() {
for pid in ${pids[@]} kill ${pids[@]} || true
do
kill $pid
done
for exec in ${testnames[@]} for exec in ${testnames[@]}
do do
pkill -f $exec pkill -f $exec || true
done done
} }
for exec in ${testnames[@]} trap killchildren INT TERM EXIT
mkdir -p $log
mkdir -p $savedir
while true
do do
(cd $toku_toplevel; \
svn update; \
make CC=icc DEBUG=0 HAVE_CILK=0 clean fastbuild; \
make CC=icc DEBUG=0 HAVE_CILK=0 -C src/tests ${testnames[@]})
cd $src_tests
running=yes
for exec in ${testnames[@]}
do
for table_size in 2000 200000 50000000 for table_size in 2000 200000 50000000
do do
(( small_cachetable = table_size * 50 )) (( small_cachetable = table_size * 50 ))
...@@ -211,11 +214,20 @@ do ...@@ -211,11 +214,20 @@ do
loop_test $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${suffix}" & savepid $! loop_test $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
tail -f "${log}/${suffix}" & savepid $! tail -f "${log}/${suffix}" & savepid $!
done done
done done
trap killchildren INT TERM EXIT sleep 1d
for pid in ${pids[@]} running=no
do
wait $pid killchildren
wait ${pids[@]} || true
idx=0
for pid in ${pids[@]}
do
pids[$idx]=0
(( idx = idx + 1 ))
done
done done
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment