Guillaume Smet wrote:
> On Mon, Apr 21, 2008 at 7:25 PM, Magnus Hagander <magnus@hagander.net> wrote:
> > Not really, but it did need a couple of adjustments :-)
> >
> > It's been running fine now for a number of hours, with output that
> > looks similar to the stuff you posted. I'll leave it running..
>
> If you can come up with an easily installable tarball, I can dedicate
> 1 or 2 boxes to run it 24/7.
Sure. I updated the script so it will be clearer what you have to
modify.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
#!/bin/bash
REGRESSION_DURATION= # average duration of regression test, in seconds
OUTFILE=
[ "$REGRESSION_DURATION" -o ! "$OUTFILE" ] &&
echo "Must set REGRESSION_DURATION and OUTFILE in the script" 1>&2 &&
exit 1
[ ! -f parallel_schedule ] &&
echo "This must be from the Postgres src/test/regress directory" 1>&2 &&
exit 1
if gmake -h > /dev/null 2>&1
then MAKE=gmake
else MAKE=make
fi
# To analyze output, use:
echo "Running ..."
echo "To analyze the output log file, use:"
echo "grep '^\+ *[A-Z][A-Z]*:' /rtmp/regression.sigterm | sort | uniq | less"
while :
do
(
SLEEP=`expr $RANDOM \* $REGRESSION_DURATION / 32767`
echo "Sleeping $SLEEP seconds"
sleep "$SLEEP"
echo "Trying kill"
# send up to 7 kill signals
for X in 1 2 3 4 5 6 7
do
psql -p 55432 -qt -c "
SELECT pg_terminate_backend(stat.procpid)
FROM (SELECT procpid FROM pg_stat_activity
ORDER BY random() LIMIT 1) AS stat
" template1 2> /dev/null
if [ "$?" -eq 0 ]
then echo "Kill sent"
fi
sleep 5
done
) &
$MAKE check
wait
[ -s regression.diffs ] && cat regression.diffs >> "$OUTFILE"
done