If a server dies during execution of a test case, this will be interpreted as a failure. However, there may be cases where you actually want to stop and possibly restart a server intentionally. It is possible to let the system know you expect a server to terminate, and to either wait or have it restarted immediately:
Before you initiate the action that will stop the server, the test
case should write either restart
or
wait
to the file
$MYSQL_TMP_DIR/mysqld.1.expect
. The easiest way
to do this is using the exec echo construct
like in the following example.
If you write restart
into this file, the server
will be immediately restarted. If you write
wait
instead, the server will remain down, but
can be restarted at a later time by writing
restart
to the file.
--exec echo "wait" > $MYSQL_TMP_DIR/mysqld.1.expect --shutdown_server 10 --source include/wait_until_disconnected.inc # Do something while server is down --enable_reconnect --exec echo "restart" > $MYSQL_TMP_DIR/mysqld.1.expect --source include/wait_until_connected_again.inc
The file name to write the command to will be
mysqld.2.expect
for the slave server in
replication tests.