Commit 0ff8d486 authored by unknown's avatar unknown
Browse files

Fix of test suite in scope of fixing BUG#18023: IM: instance

can be started several times; monitor interval must be > 2sec


mysql-test/r/im_daemon_life_cycle.result:
  Updated result file.
mysql-test/r/im_life_cycle.result:
  Updated result file.
mysql-test/r/im_utils.result:
  Updated result file.
mysql-test/t/im_daemon_life_cycle-im.opt:
  Set monitoring interval to 1 second in order to:
    - be consistent with 5.1;
    - speed up tests;
mysql-test/t/im_daemon_life_cycle.imtest:
  1. Use wait_for_start.sh script to minimize chance of race condition.
  2. Polishing.
mysql-test/t/im_life_cycle.imtest:
  1. Use wait_for_start.sh and wait_for_stop.sh scripts to
     minimize chance of race condition;
  2. Remove some statements, because there is no way now to
     stabilize their output.
  3. Polishing;
mysql-test/t/im_utils.imtest:
  1. Use wait_for_start.sh script to minimize chance of race condition.
  2. Polishing.
mysql-test/t/kill_n_check.sh:
  1. Make timeout configurable by command-line argument;
  2. Change algorithm of waiting for process to restart to be
     more robust.
mysql-test/t/im_life_cycle-im.opt:
  Set monitoring interval to 1 second in order to:
    - be consistent with 5.1;
    - speed up tests;
mysql-test/t/im_utils-im.opt:
  Set monitoring interval to 1 second in order to:
    - be consistent with 5.1;
    - speed up tests;
mysql-test/t/wait_for_process.sh:
  A new helper script, intended to be used instead of dummy "sleep"
  when waiting for some process to start or stop.
parent e08a2b32
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
Success: the process has been started.
SHOW INSTANCES;
instance_name	status
mysqld1	online
+41 −35
Original line number Diff line number Diff line

--------------------------------------------------------------------
-- 1.1.1.
--------------------------------------------------------------------
Success: the process has been started.
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline
SHOW INSTANCE STATUS mysqld1;
instance_name	status	version
mysqld1	online	VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name	status	version
mysqld2	offline	VERSION

--------------------------------------------------------------------
-- 1.1.2.
--------------------------------------------------------------------
START INSTANCE mysqld2;
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	online
SHOW INSTANCE STATUS mysqld1;
instance_name	status	version
mysqld1	online	VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name	status	version
mysqld2	online	VERSION
Success: the process has been started.
SHOW VARIABLES LIKE 'port';
Variable_name	Value
port	IM_MYSQLD1_PORT
port	IM_MYSQLD2_PORT

--------------------------------------------------------------------
-- 1.1.3.
--------------------------------------------------------------------
STOP INSTANCE mysqld2;
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline
SHOW INSTANCE STATUS mysqld1;
instance_name	status	version
mysqld1	online	VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name	status	version
mysqld2	offline	VERSION
Success: the process has been stopped.

--------------------------------------------------------------------
-- 1.1.4.
--------------------------------------------------------------------
START INSTANCE mysqld3;
ERROR HY000: Bad instance name. Check that the instance with such a name exists
START INSTANCE mysqld1;
ERROR HY000: The instance is already started

--------------------------------------------------------------------
-- 1.1.5.
--------------------------------------------------------------------
STOP INSTANCE mysqld3;
ERROR HY000: Bad instance name. Check that the instance with such a name exists

--------------------------------------------------------------------
-- 1.1.6.
--------------------------------------------------------------------
SHOW INSTANCES;
instance_name	status
mysqld1	online
@@ -50,20 +51,25 @@ SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline

--------------------------------------------------------------------
-- 1.1.7.
--------------------------------------------------------------------
START INSTANCE mysqld2;
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	online
Success: the process has been started.
Killing the process...
Sleeping...
Success: the process was killed.
SHOW INSTANCES;
instance_name	status
mysqld1	online
mysqld2	offline

--------------------------------------------------------------------
-- 1.1.8.
--------------------------------------------------------------------
SHOW INSTANCE STATUS;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use

--------------------------------------------------------------------
-- BUG#12813
--------------------------------------------------------------------
START INSTANCE mysqld1,mysqld2,mysqld3;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
STOP INSTANCE mysqld1,mysqld2,mysqld3;
+3 −0
Original line number Diff line number Diff line
Success: the process has been started.
SHOW INSTANCES;
instance_name	status
mysqld1	online
@@ -42,7 +43,9 @@ skip-innodb VALUE
skip-bdb	VALUE
skip-ndbcluster	VALUE
START INSTANCE mysqld2;
Success: the process has been started.
STOP INSTANCE mysqld2;
Success: the process has been stopped.
SHOW mysqld1 LOG FILES;
Logfile	Path	File size
ERROR LOG	PATH	FILE_SIZE
+1 −0
Original line number Diff line number Diff line
--run-as-service
--log=$MYSQLTEST_VARDIR/log/im.log
--monitoring-interval=1
+17 −1
Original line number Diff line number Diff line
@@ -10,6 +10,22 @@

###########################################################################

# Wait for mysqld1 (guarded instance) to start.

--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD1_PATH_PID 30 started

# Let IM detect that mysqld1 is online. This delay should be longer than
# monitoring interval.

--sleep 3

# Check that start conditions are as expected.

SHOW INSTANCES;

--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted
###########################################################################

# Kill the IM main process and check that the IM Angel will restart the main
# process.

--exec $MYSQL_TEST_DIR/t/kill_n_check.sh $IM_PATH_PID restarted 30
Loading