Wait longer for sandboxes to start. Dump their info better if they don't.

This commit is contained in:
Daniel Nichter
2012-07-31 16:30:52 -06:00
parent 5754649a39
commit 8b15e2936b
2 changed files with 35 additions and 18 deletions

View File

@@ -41,18 +41,21 @@ $BASEDIR/bin/mysqld_safe --defaults-file=/tmp/PORT/my.sandbox.cnf > /dev/null 2>
cd $PWD
echo -n "Starting MySQL test server on port PORT... "
for i in 1 2 3 4 5 6 7 8 9 10; do
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
sleep 1
if [ -f $PIDFILE ] && [ -S $SOCKETFILE ]; then
if [ -f $PIDFILE -a -S $SOCKETFILE -a -s "/tmp/PORT/data/ibdata1" ]; then
break
fi
done
sandbox_is_alive
if [ $? -eq 1 ]; then
echo "OK"
exit 0
else
echo "FAILED"
exit 1
fi
for i in 1 2 3 4 5; do
sandbox_is_alive
if [ $? -eq 1 ]; then
echo "OK"
exit 0
fi
sleep 1
done
echo "FAILED"
exit 1

View File

@@ -7,17 +7,29 @@
# Exist 0 on success/no errors, or 1 on any warnings or errors.
err() {
echo "MySQL processes:" >&2
ps x | grep mysql >&2
echo "Sandbox servers:" >&2
ls /tmp/1234? >&2
ls /tmp/290? >&2
echo
for msg; do
echo "$msg" >&2
done
if [ "$DEBUG_SANDBOXES" ]; then
echo
echo "MySQL processes:" >&2
ps x | grep mysql >&2
echo
for p in 12345 12346 12347; do
echo "Sandbox $p:" >&2
if [ -d "/tmp/$p" ]; then
ls -lh /tmp/$p/* >&2
echo
cat /tmp/$p/data/mysqld.log >&2
echo
tail -n 100 /tmp/$p/data/genlog >&2
else
echo "/tmp/$p does not exist" >&2
fi
done
fi
}
usage() {
@@ -315,6 +327,7 @@ case $opt in
if [ $exit_status -eq 0 ]; then
echo "Percona Toolkit test environment started with MySQL v$MYSQL_VERSION."
else
DEBUG_SANDBOXES=1
err "There was an error starting the Percona Toolkit test environment."
fi
;;
@@ -327,6 +340,7 @@ case $opt in
if [ $exit_status -eq 0 ]; then
echo "Percona Toolkit test environment stopped."
else
DEBUG_SANDBOXES=1
err "Error stopping the Percona Toolkit test environment."
fi
;;