List:Commits« Previous MessageNext Message »
From:Serge.Kozlov Date:February 4 2011 11:00am
Subject:Re: bzr commit into mysql-5.5 branch (Serge.Kozlov:3298) Bug#43828
Bug#59494
View as plain text  
Hi, Sven.

The patch is updated: asserts added.

04.02.2011 11:33, Sven Sandberg пишет:
> Hi Serge,
>
> Thanks for fixing this test. While you are modifying it, would you 
> mind improving one thing? We should avoid relying on comparison with 
> the result file and use assertions instead: see comments inline. /Sven
>
>
> On 02/02/2011 09:27 PM, Serge Kozlov wrote:
>> #At file:///home/ksm/oracle/repo/QA/bugs/build-5.5/ based on 
>> revid:dmitry.lenev@stripped
>>
>> 3298 Serge Kozlov 2011-02-02
>> Bug#43828, Bug#59494.
>> After introducing new way of initialization of replication the 
>> setting different heartbeat periods for slaves was missed.
>> The patch fix it.
>>
>> modified:
>> mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
>> mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
>> === modified file 'mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result'
>> --- a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result 2010-12-19 
>> 17:15:12 +0000
>> +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result 2011-02-02 
>> 20:27:47 +0000
>> @@ -2,13 +2,22 @@ include/rpl_init.inc [topology=1->2,1->3
>> include/rpl_connect.inc [creating master]
>> include/rpl_connect.inc [creating slave_1]
>> include/rpl_connect.inc [creating slave_2]
>> +include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
>> +include/start_slave.inc
>> +include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
>> +include/start_slave.inc
>> Slave has received heartbeat event
>> slave_2 has received heartbeat event
>> -slave_1 has received more heartbeats than slave_2 (1 means 'yes'): 0
>> +slave_1 has received more heartbeats than slave_2 (1 means 'yes'): 1
>
> Instead of printing this to the result log, can you add an assertion 
> to the test? You can use include/assert.inc, like this:
>
> --let $assert_cond= [slave_1:SHOW STATUS LIKE 
> "slave_received_heartbeats", Value, 1] < [slave_2:SHOW STATUS LIKE 
> "slave_received_heartbeats", Value, 1]
> --let $assert_text= slave_2 should have received more heartbeats than 
> slave_1
> --source include/assert.inc
>
>>
>> include/rpl_stop_slaves.inc
>> include/rpl_change_topology.inc [new topology=1->3->2]
>> include/rpl_start_slaves.inc
>> +include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
>> +include/start_slave.inc
>> slave_1 has received heartbeat event
>> [on master]
>> CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
>> @@ -26,7 +35,7 @@ Tables_in_test
>> [on master]
>> creating updates on master and send to slave_2 during 5 second
>> [on slave_1]
>> -slave_1 has received heartbeats (1 means 'yes'): 0
>> +slave_1 has received heartbeats (1 means 'yes'): 1
>
> Same as above: can you use an assert instead?
>
>>
>> *** Clean up ***
>> DROP TABLE t1;
>>
>> === modified file 'mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test'
>> --- a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test 2010-12-19 
>> 17:15:12 +0000
>> +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test 2011-02-02 
>> 20:27:47 +0000
>> @@ -20,7 +20,19 @@
>> --source include/rpl_connect.inc
>>
>> #
>> -# Testing heartbeat
>> +# Set different heartbeat periods for slaves
>> +#
>> +--connection slave_1
>> +--source include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
>> +--source include/start_slave.inc
>> +--connection slave_2
>> +--source include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
>> +--source include/start_slave.inc
>> +
>> +#
>> +# Testing heartbeat for one master and two slaves
>> #
>>
>> # Check that heartbeat events sent to both slaves with correct periods
>> @@ -54,6 +66,10 @@ let $result= query_get_value(SELECT ($sl
>> --let $rpl_topology= 1->3->2
>> --source include/rpl_change_topology.inc
>> --source include/rpl_start_slaves.inc
>> +--connection slave_1
>> +--source include/stop_slave.inc
>> +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
>> +--source include/start_slave.inc
>>
>> # Check heartbeat for new replication channel slave_2->slave
>> let $status_var= slave_received_heartbeats;
>>
>>
>>
>>
>>
>


-- 
Serge Kozlov, QA Developer,
Replication team,
Oracle Development SPB/MySQL, www.mysql.com

Thread
bzr commit into mysql-5.5 branch (Serge.Kozlov:3298) Bug#43828 Bug#59494Serge Kozlov2 Feb
  • Re: bzr commit into mysql-5.5 branch (Serge.Kozlov:3298) Bug#43828Bug#59494Sven Sandberg4 Feb
    • Re: bzr commit into mysql-5.5 branch (Serge.Kozlov:3298) Bug#43828Bug#59494Serge.Kozlov4 Feb