mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
cf9038e979
fails randomly. The problem was that the test case used command line tool (mysql) without specifying connect_timeout argument. In some cases, this lead to hanging of the test case. The fix is to specify --connect_timeout=1 when starting mysql. Also, the patch contains polishing and various cleanups to simplify analyzing of the problems further. The patch affects only test suite, no server codebase has been touched. mysql-test/lib/mtr_im.pl: Remember PID of the IM-spawner -- a process, that is used to fork IM-angel. mysql-test/lib/mtr_io.pl: Trim \n from the PID. mysql-test/lib/mtr_process.pl: Don't complain if it was IM-spawner, who died. mysql-test/r/im_daemon_life_cycle.result: Update the result file. mysql-test/r/im_life_cycle.result: Update the result file. mysql-test/t/im_daemon_life_cycle.imtest: Polishing: add more comments, be more verbose. mysql-test/t/im_life_cycle.imtest: Polishing: be more verbose. mysql-test/t/im_utils.imtest: Polishing: be more verbose. mysql-test/t/kill_n_check.sh: Log messages to the extrenal file so that they can be analyzed if test case failed. mysql-test/t/wait_for_process.sh: Log messages to the extrenal file so that they can be analyzed if test case failed. mysql-test/t/wait_for_socket.sh: Log messages to the extrenal file so that they can be analyzed if test case failed. mysql-test/t/log.sh: Dummy script to facilitate logging from test-scripts. mysql-test/t/utils.sh: A bunch of auxilary functions to facilitate logging.
93 lines
3.7 KiB
Text
93 lines
3.7 KiB
Text
###########################################################################
|
|
#
|
|
# This file contains test for (1.2) test suite.
|
|
#
|
|
# Consult WL#2789 for more information.
|
|
#
|
|
###########################################################################
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle im_daemon_life_cycle.imtest started.
|
|
|
|
###########################################################################
|
|
|
|
--source include/im_check_env.inc
|
|
|
|
# Turn on reconnect, not on by default anymore.
|
|
--enable_reconnect
|
|
|
|
###########################################################################
|
|
#
|
|
# The main daemon-life-cycle test case -- check that IM-angel will restart
|
|
# IM-main if it got killed:
|
|
# - kill IM-main and check that IM-angel will restart it;
|
|
# - wait for IM-main to start accepting connections before continue test
|
|
# case;
|
|
#
|
|
###########################################################################
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Main-test: starting...
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main...
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 30 im_daemon_life_cycle
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 30 im_daemon_life_cycle
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Main-test: done.
|
|
|
|
###########################################################################
|
|
#
|
|
# BUG#12751: Instance Manager: client hangs
|
|
# - start nonguarded instance (mysqld2);
|
|
# - kill IM-main and get it restarted by IM-angel;
|
|
# - check that guarded instance (mysqld1) is accepting connections.
|
|
# - check that non-guarded instance (mysqld2) were not stopped.
|
|
#
|
|
###########################################################################
|
|
|
|
--echo
|
|
--echo --------------------------------------------------------------------
|
|
--echo -- Test for BUG#12751
|
|
--echo --------------------------------------------------------------------
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: starting...
|
|
|
|
# 1. Start mysqld;
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: starting...
|
|
START INSTANCE mysqld2;
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to start...
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 started im_daemon_life_cycle
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: started.
|
|
|
|
# 2. Restart IM-main;
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Killing IM-main...
|
|
--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 30 im_daemon_life_cycle
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Waiting for IM-main to start accepting connections...
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_socket.sh $EXE_MYSQL $IM_PATH_SOCK $IM_USERNAME $IM_PASSWORD '' 30 im_daemon_life_cycle
|
|
|
|
# 3. Issue some statement -- connection should be re-established.
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle Checking that IM-main processing commands...
|
|
|
|
--replace_column 3 VERSION
|
|
SHOW INSTANCE STATUS mysqld1;
|
|
|
|
# 4. Stop mysqld2, because it will not be stopped by IM, as it is nonguarded.
|
|
# So, if it we do not stop it, it will be stopped by mysql-test-run.pl with
|
|
# warning.
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopping...
|
|
STOP INSTANCE mysqld2;
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: waiting to stop...
|
|
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD2_PATH_PID 30 stopped im_daemon_life_cycle
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle mysqld2: stopped.
|
|
|
|
###########################################################################
|
|
|
|
--exec $MYSQL_TEST_DIR/t/log.sh im_daemon_life_cycle BUG12751: done.
|