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
...@@ -71,7 +73,7 @@ done ...@@ -71,7 +73,7 @@ done
src_tests="${toku_toplevel}/src/tests" src_tests="${toku_toplevel}/src/tests"
testnames=(recover-test_stress1.tdb \ testnames=(recover-test_stress1.tdb \
recover-test_stress2.tdb) recover-test_stress2.tdb)
save_failure() { save_failure() {
dir="$1"; shift dir="$1"; shift
...@@ -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,58 +168,66 @@ loop_test() { ...@@ -164,58 +168,66 @@ 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
for table_size in 2000 200000 50000000 (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 do
(( small_cachetable = table_size * 50 )) for table_size in 2000 200000 50000000
suffix="${exec}-${table_size}-${small_cachetable}-$$" do
touch "${log}/${suffix}" (( small_cachetable = table_size * 50 ))
loop_test $exec $table_size $small_cachetable "${log}/${suffix}" "${savedir}/${suffix}" & savepid $! suffix="${exec}-${table_size}-${small_cachetable}-$$"
tail -f "${log}/${suffix}" & savepid $! touch "${log}/${suffix}"
suffix="${exec}-${table_size}-1000000000-$$" loop_test $exec $table_size $small_cachetable "${log}/${suffix}" "${savedir}/${suffix}" & savepid $!
touch "${log}/${suffix}" tail -f "${log}/${suffix}" & savepid $!
loop_test $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${suffix}" & savepid $! suffix="${exec}-${table_size}-1000000000-$$"
tail -f "${log}/${suffix}" & savepid $! touch "${log}/${suffix}"
loop_test $exec $table_size 1000000000 "${log}/${suffix}" "${savedir}/${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
done
wait ${pids[@]} || true
idx=0
for pid in ${pids[@]}
do
pids[$idx]=0
(( idx = idx + 1 ))
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