Skip to content

Commit

Permalink
Fix spurious failures of the rpl_start_stop_slave test case.
Browse files Browse the repository at this point in the history
Wait for the slave thread to reach the desired state (connected to
master and waiting for events to arrive) before attempting to retrieve
its connection ID.
  • Loading branch information
Davi Arnaut committed Dec 15, 2012
1 parent f34848d commit 958b433
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mysql-test/suite/rpl/r/rpl_start_stop_slave.result
Expand Up @@ -3,7 +3,7 @@ include/master-slave.inc
set @time_before_kill := (select CURRENT_TIMESTAMP);
[Time before the query]
[Connection ID of the slave I/O thread found]
kill <connection_id>;
kill @slave_id;
set @time_after_kill := (select CURRENT_TIMESTAMP);
[Time after the query]
[Killing of the slave IO thread was successful]
Expand Down
8 changes: 5 additions & 3 deletions mysql-test/suite/rpl/t/rpl_start_stop_slave.test
Expand Up @@ -19,15 +19,17 @@
--source include/master-slave.inc

connection slave;
--let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'`
let $wait_condition=
SELECT @slave_id := (SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE state = 'Waiting for master to send event');
--source include/wait_condition_sp.inc

set @time_before_kill := (select CURRENT_TIMESTAMP);

--echo [Time before the query]
--echo [Connection ID of the slave I/O thread found]

--replace_regex /kill [0-9]*/kill <connection_id>/
--eval kill $connection_id
kill @slave_id;

set @time_after_kill := (select CURRENT_TIMESTAMP);

Expand Down

0 comments on commit 958b433

Please sign in to comment.