mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
Wait longer for sandboxes to start. Dump their info better if they don't.
This commit is contained in:
@@ -41,18 +41,21 @@ $BASEDIR/bin/mysqld_safe --defaults-file=/tmp/PORT/my.sandbox.cnf > /dev/null 2>
|
|||||||
cd $PWD
|
cd $PWD
|
||||||
|
|
||||||
echo -n "Starting MySQL test server on port PORT... "
|
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
|
sleep 1
|
||||||
if [ -f $PIDFILE ] && [ -S $SOCKETFILE ]; then
|
if [ -f $PIDFILE -a -S $SOCKETFILE -a -s "/tmp/PORT/data/ibdata1" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
sandbox_is_alive
|
for i in 1 2 3 4 5; do
|
||||||
if [ $? -eq 1 ]; then
|
sandbox_is_alive
|
||||||
echo "OK"
|
if [ $? -eq 1 ]; then
|
||||||
exit 0
|
echo "OK"
|
||||||
else
|
exit 0
|
||||||
echo "FAILED"
|
fi
|
||||||
exit 1
|
sleep 1
|
||||||
fi
|
done
|
||||||
|
|
||||||
|
echo "FAILED"
|
||||||
|
exit 1
|
||||||
|
@@ -7,17 +7,29 @@
|
|||||||
# Exist 0 on success/no errors, or 1 on any warnings or errors.
|
# Exist 0 on success/no errors, or 1 on any warnings or errors.
|
||||||
|
|
||||||
err() {
|
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
|
for msg; do
|
||||||
echo "$msg" >&2
|
echo "$msg" >&2
|
||||||
done
|
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() {
|
usage() {
|
||||||
@@ -315,6 +327,7 @@ case $opt in
|
|||||||
if [ $exit_status -eq 0 ]; then
|
if [ $exit_status -eq 0 ]; then
|
||||||
echo "Percona Toolkit test environment started with MySQL v$MYSQL_VERSION."
|
echo "Percona Toolkit test environment started with MySQL v$MYSQL_VERSION."
|
||||||
else
|
else
|
||||||
|
DEBUG_SANDBOXES=1
|
||||||
err "There was an error starting the Percona Toolkit test environment."
|
err "There was an error starting the Percona Toolkit test environment."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -327,6 +340,7 @@ case $opt in
|
|||||||
if [ $exit_status -eq 0 ]; then
|
if [ $exit_status -eq 0 ]; then
|
||||||
echo "Percona Toolkit test environment stopped."
|
echo "Percona Toolkit test environment stopped."
|
||||||
else
|
else
|
||||||
|
DEBUG_SANDBOXES=1
|
||||||
err "Error stopping the Percona Toolkit test environment."
|
err "Error stopping the Percona Toolkit test environment."
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
Reference in New Issue
Block a user