Commit 98cbdb13 authored by Serge Kozlov's avatar Serge Kozlov

WL#4641, Bug#43828: fix for rpl_heartbeat_basic.test:

The issue appears when number of heartbeat events non-zero before start of test
block. But really we need to check that no new events has received during test block.
So I did following:
1. Replace absolute values by diff of values
2. Increase heartbeat period from 1.5 to 5 sec
parent 9e805297
......@@ -220,15 +220,10 @@ BEGIN
UPDATE test.t1 SET a = a + 1 WHERE a < 10;
END|
RESET SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1.5;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
include/start_slave.inc
SET @@global.event_scheduler=1;
SHOW STATUS LIKE 'slave_received_heartbeats';
Variable_name Value
Slave_received_heartbeats 0
SHOW STATUS LIKE 'slave_received_heartbeats';
Variable_name Value
Slave_received_heartbeats 0
Number of received heartbeat events: 0
DELETE FROM t1;
DROP EVENT e1;
......
......@@ -343,23 +343,28 @@ DELIMITER ;|
--connection slave
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=1.5;
eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_HEARTBEAT_PERIOD=5;
--source include/start_slave.inc
--connection master
# Enable scheduler
SET @@global.event_scheduler=1;
--connection slave
SHOW STATUS LIKE 'slave_received_heartbeats';
let $rcvd_heartbeats_before= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
--sync_with_master
# Wait some updates for table t1 from master
let $wait_condition= SELECT COUNT(*)=1 FROM t1 WHERE a > 5;
--source include/wait_condition.inc
SHOW STATUS LIKE 'slave_received_heartbeats';
let $rcvd_heartbeats_after= query_get_value(SHOW STATUS LIKE 'slave_received_heartbeats', Value, 1);
let $result= query_get_value(SELECT ($rcvd_heartbeats_after - $rcvd_heartbeats_before) > 0 AS Result, Result, 1);
--echo Number of received heartbeat events: $result
--connection master
DELETE FROM t1;
DROP EVENT e1;
--echo
# Check received heartbeat events while logs flushed on slave
--connection slave
--echo *** Flush logs on slave ***
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment