diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/rpl/r/rpl_start_stop_slave.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_critical_errors.test | 3 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_err_ignoredtable.test | 3 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_init_slave.test | 1 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_insert.test | 14 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_loadfile.test | 7 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_row_sp001.test | 6 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_row_sp005.test | 3 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_row_stop_middle.test | 3 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_row_trig001.test | 6 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_row_trig003.test | 8 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_ssl1.test | 3 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_start_stop_slave.test | 9 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test | 3 | ||||
-rw-r--r-- | mysql-test/suite/rpl/t/rpl_temporary.test | 11 |
15 files changed, 45 insertions, 37 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result index 1fcb586d1fb..04ece812f35 100644 --- a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result @@ -4,8 +4,8 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -stop slave; create table t1(n int); +stop slave; start slave; stop slave io_thread; start slave io_thread; diff --git a/mysql-test/suite/rpl/t/rpl_critical_errors.test b/mysql-test/suite/rpl/t/rpl_critical_errors.test index abf827c8d1f..b35cd305f92 100644 --- a/mysql-test/suite/rpl/t/rpl_critical_errors.test +++ b/mysql-test/suite/rpl/t/rpl_critical_errors.test @@ -34,7 +34,8 @@ connection master1; # This sleep is picked so that the query above has started to insert # some rows into t2. If it hasn't the slave will not stop below. -sleep 4; +let $wait_condition= SELECT COUNT(*) > 1000 FROM t1; +source include/wait_condition.inc # SHOW PROCESSLIST; diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test index 4e06a6a7096..b9ab66165cc 100644 --- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test +++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test @@ -43,7 +43,8 @@ insert into t3 values(connection_id()); send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10); connection master1; -real_sleep 2; +let $wait_condition= SELECT a > 1 FROM t2; +source include/wait_condition.inc; select (@id := id) - id from t3; kill @id; drop table t2,t3; diff --git a/mysql-test/suite/rpl/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test index 139b4902e12..6125f0a7c45 100644 --- a/mysql-test/suite/rpl/t/rpl_init_slave.test +++ b/mysql-test/suite/rpl/t/rpl_init_slave.test @@ -6,7 +6,6 @@ source include/master-slave.inc; save_master_pos; connection slave; -sleep 1; show variables like 'init_slave'; show variables like 'max_connections'; sync_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test index 0d471a0e0a9..504ca1809ad 100644 --- a/mysql-test/suite/rpl/t/rpl_insert.test +++ b/mysql-test/suite/rpl/t/rpl_insert.test @@ -17,18 +17,8 @@ let $query = "INSERT DELAYED INTO t1 VALUES (1, 'Dr. No'), (2, 'From Russia With --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=200 --query=$query --delimiter=";" # Wait until all the 5000 inserts has been inserted into the table ---disable_query_log -let $counter= 300; # Max 30 seconds wait -while (`select count(*)!=5000 from mysqlslap.t1`) -{ - sleep 0.1; - dec $counter; - if (!$counter) - { - Number of records in t1 didnt reach 5000; - } -} ---enable_query_log +let $wait_condition= SELECT COUNT(*) = 5000 FROM mysqlslap.t1; +--source include/wait_condition.inc SELECT COUNT(*) FROM mysqlslap.t1; sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test index a671bab15bb..532db77c248 100644 --- a/mysql-test/suite/rpl/t/rpl_loadfile.test +++ b/mysql-test/suite/rpl/t/rpl_loadfile.test @@ -36,11 +36,12 @@ delimiter ;| CALL test.p1(); SELECT * FROM test.t1 ORDER BY blob_column; save_master_pos; -# Need to allow some time when NDB engine is used for -# the injector thread to have time to populate binlog -sleep 10; sync_slave_with_master; connection slave; +# Need to allow some time when NDB engine is used for +# the injector thread to have time to populate binlog +let $wait_condition= SELECT INSTR(blob_column,'aberration') > 0 FROM test.t1 WHERE a = 2; +--source include/wait_condition.inc SELECT * FROM test.t1 ORDER BY blob_column; # Cleanup diff --git a/mysql-test/suite/rpl/t/rpl_row_sp001.test b/mysql-test/suite/rpl/t/rpl_row_sp001.test index c12e73b6861..1595c4a21d5 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp001.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp001.test @@ -46,11 +46,15 @@ delimiter ;// -- disable_query_log -- disable_result_log +SET @wait_count=1; let $1=10; while ($1) { call test.p1(); - sleep 1; + let $wait_condition= SELECT COUNT(*) = @wait_count FROM test.t1; + -- source include/wait_condition.inc + -- disable_query_log + SET @wait_count = @wait_count + 1; dec $1; } -- enable_result_log diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test index 054fa02f514..acd2f4511a0 100644 --- a/mysql-test/suite/rpl/t/rpl_row_sp005.test +++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test @@ -84,7 +84,8 @@ let $message=< ---- Master selects-- >; --source include/show_msg.inc connection master; CALL test.p1(); -sleep 6; +let $wait_condition= SELECT COUNT(*) = 4 FROM t3; +--source include/wait_condition.inc SELECT * FROM test.t3 ORDER BY id3; let $message=< ---- Slave selects-- >; diff --git a/mysql-test/suite/rpl/t/rpl_row_stop_middle.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test index da363736100..bc169bebfcd 100644 --- a/mysql-test/suite/rpl/t/rpl_row_stop_middle.test +++ b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test @@ -33,7 +33,8 @@ start slave; # hope one second is not enough for slave to reach the last # Rows_log_event, so that test actually tests something. -real_sleep 1; +let $wait_condition= SELECT COUNT(*) >= 10 FROM t1; +--source include/wait_condition.inc stop slave; # see if slave hangs on DROP TABLE diff --git a/mysql-test/suite/rpl/t/rpl_row_trig001.test b/mysql-test/suite/rpl/t/rpl_row_trig001.test index 7b1fca2d6a1..83d0f03301d 100644 --- a/mysql-test/suite/rpl/t/rpl_row_trig001.test +++ b/mysql-test/suite/rpl/t/rpl_row_trig001.test @@ -53,11 +53,15 @@ delimiter ;// -- disable_query_log -- disable_result_log +SET @wait_count = 1; let $1=10; while ($1) { CALL test.p2(); - sleep 1; + let $wait_condition= SELECT COUNT(*) = @wait_count FROM test.t3; + --source include/wait_condition.inc + --disable_query_log + SET @wait_count = @wait_count + 1; dec $1; } -- enable_result_log diff --git a/mysql-test/suite/rpl/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test index 4a1bbc5ca89..5d667e29d69 100644 --- a/mysql-test/suite/rpl/t/rpl_row_trig003.test +++ b/mysql-test/suite/rpl/t/rpl_row_trig003.test @@ -108,11 +108,13 @@ UPDATE test.t2 SET b1 = 0 WHERE b1 = 1; INSERT INTO test.t1 VALUES(NULL,1,'add some more test data test.', 'and hope for the best', 3.321,5.221,0,YEAR(NOW()),NOW()); -# To make sure BUG#14698 is gone, we sleep 2 seconds before calling trigger +# To make sure BUG#14698 is gone, we sleep before calling trigger # (with the bug in, that caused differences in TIMESTAMP columns). # We just need to let the machine's clock advance, it's not -# to do synchronization, so real_sleep is good. -real_sleep 2; +# to do synchronization. + +let $wait_condition= SELECT SUM(f)= ROUND(SUM(f)) FROM t3; +--source include/wait_condition.inc DELETE FROM test.t1 WHERE id = 1; diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test index b660c3991dd..b5355d737d5 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl1.test +++ b/mysql-test/suite/rpl/t/rpl_ssl1.test @@ -24,7 +24,8 @@ start slave; connection master; insert into t1 values (1); #reasonable timeout for changes to propagate to slave -sleep 3; +let $wait_condition= SELECT COUNT(*) = 1 FROM t1; +source include/wait_condition.inc; connection slave; select * from t1; diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test index 19988cf902a..93c613f4cf4 100644 --- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test @@ -3,12 +3,12 @@ source include/master-slave.inc; # # Bug#6148 () # -connection slave; -stop slave; - # Let the master do lots of insertions connection master; create table t1(n int); +sync_slave_with_master; +stop slave; +connection master; let $1=5000; disable_query_log; while ($1) @@ -21,7 +21,8 @@ save_master_pos; connection slave; start slave; -sleep 1; +let $wait_condition= SELECT COUNT(*) > 0 FROM t1; +source include/wait_condition.inc; stop slave io_thread; start slave io_thread; sync_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index 05dcb91ca28..adda4f67694 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -293,7 +293,8 @@ insert delayed into t2 values(rand()); set @a=2.345; insert delayed into t2 values(@a); -sleep 4; # time for the delayed inserts to reach disk +let $wait_condition= SELECT COUNT(*) = 19 FROM t2; +--source include/wait_condition.inc # If you want to do manual testing of the mixed mode regarding UDFs (not # testable automatically as quite platform- and compiler-dependent), diff --git a/mysql-test/suite/rpl/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test index 852dfdbc25c..6619f4518b9 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary.test +++ b/mysql-test/suite/rpl/t/rpl_temporary.test @@ -60,23 +60,24 @@ insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); connection con1; create temporary table t3(f int); insert into t3 select * from t1 where f<6; -sleep 1; +let $wait_condition= SELECT COUNT(*) = 5 FROM t3; +--source include/wait_condition.inc connection con2; create temporary table t3(f int); -sleep 1; connection con1; insert into t2 select count(*) from t3; -sleep 1; +let $wait_condition= SELECT COUNT(*) = 1 FROM t2; +--source include/wait_condition.inc connection con2; insert into t3 select * from t1 where f>=4; -sleep 1; +let $wait_condition= SELECT COUNT(*) = 7 FROM t3; +--source include/wait_condition.inc connection con1; drop temporary table t3; -sleep 1; connection con2; insert into t2 select count(*) from t3; |