diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index 0c3a98d5d9065d4fc7478d45547e00dfed8d7f5b..0377716698ce81a9de1f76fd15ebd20847ce2d75 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -93,7 +93,7 @@ Variable_name	Value
 Rpl_semi_sync_master_no_tx	0
 show status like 'Rpl_semi_sync_master_yes_tx';
 Variable_name	Value
-Rpl_semi_sync_master_yes_tx	301
+Rpl_semi_sync_master_yes_tx	11
 [ on slave ]
 [ slave status after replicated inserts ]
 show status like 'Rpl_semi_sync_slave_status';
@@ -101,13 +101,13 @@ Variable_name	Value
 Rpl_semi_sync_slave_status	ON
 select count(distinct a) from t1;
 count(distinct a)
-300
+10
 select min(a) from t1;
 min(a)
 1
 select max(a) from t1;
 max(a)
-300
+10
 
 # BUG#50157
 # semi-sync replication crashes when replicating a transaction which
@@ -133,6 +133,7 @@ SET SESSION AUTOCOMMIT= 1;
 #
 include/stop_slave.inc
 [ on master ]
+set global rpl_semi_sync_master_timeout= 5000;
 [ master status should be ON ]
 show status like 'Rpl_semi_sync_master_status';
 Variable_name	Value
@@ -142,7 +143,7 @@ Variable_name	Value
 Rpl_semi_sync_master_no_tx	0
 show status like 'Rpl_semi_sync_master_yes_tx';
 Variable_name	Value
-Rpl_semi_sync_master_yes_tx	304
+Rpl_semi_sync_master_yes_tx	14
 show status like 'Rpl_semi_sync_master_clients';
 Variable_name	Value
 Rpl_semi_sync_master_clients	1
@@ -157,7 +158,7 @@ Variable_name	Value
 Rpl_semi_sync_master_no_tx	1
 show status like 'Rpl_semi_sync_master_yes_tx';
 Variable_name	Value
-Rpl_semi_sync_master_yes_tx	304
+Rpl_semi_sync_master_yes_tx	14
 insert into t1 values (100);
 [ master status should be OFF ]
 show status like 'Rpl_semi_sync_master_status';
@@ -165,10 +166,10 @@ Variable_name	Value
 Rpl_semi_sync_master_status	OFF
 show status like 'Rpl_semi_sync_master_no_tx';
 Variable_name	Value
-Rpl_semi_sync_master_no_tx	302
+Rpl_semi_sync_master_no_tx	12
 show status like 'Rpl_semi_sync_master_yes_tx';
 Variable_name	Value
-Rpl_semi_sync_master_yes_tx	304
+Rpl_semi_sync_master_yes_tx	14
 #
 # Test semi-sync status on master will be ON again when slave catches up
 #
@@ -198,10 +199,10 @@ Variable_name	Value
 Rpl_semi_sync_master_status	ON
 show status like 'Rpl_semi_sync_master_no_tx';
 Variable_name	Value
-Rpl_semi_sync_master_no_tx	302
+Rpl_semi_sync_master_no_tx	12
 show status like 'Rpl_semi_sync_master_yes_tx';
 Variable_name	Value
-Rpl_semi_sync_master_yes_tx	304
+Rpl_semi_sync_master_yes_tx	14
 show status like 'Rpl_semi_sync_master_clients';
 Variable_name	Value
 Rpl_semi_sync_master_clients	1
@@ -217,10 +218,10 @@ include/stop_slave.inc
 [ Semi-sync master status variables before FLUSH STATUS ]
 SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
 Variable_name	Value
-Rpl_semi_sync_master_no_tx	302
+Rpl_semi_sync_master_no_tx	12
 SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
 Variable_name	Value
-Rpl_semi_sync_master_yes_tx	305
+Rpl_semi_sync_master_yes_tx	15
 FLUSH NO_WRITE_TO_BINLOG STATUS;
 [ Semi-sync master status variables after FLUSH STATUS ]
 SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index 228757496f3f9315d7812a208528562f229fd545..21967fb6f8c1ba24b0bf49ddbd684ac641e52435 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -63,7 +63,7 @@ if ($value == No such row)
 {
     set sql_log_bin=0;
     eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
-    set global rpl_semi_sync_master_timeout= 5000; /* 5s */
+    set global rpl_semi_sync_master_timeout= 60000; /* 60s */
     set sql_log_bin=1;
 }
 enable_query_log;
@@ -170,7 +170,7 @@ replace_result $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
 replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE;
 eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
 
-let $i=300;
+let $i=10;
 echo [ insert records to table ];
 disable_query_log;
 while ($i)
@@ -234,6 +234,7 @@ source include/stop_slave.inc;
 
 connection master;
 echo [ on master ];
+set global rpl_semi_sync_master_timeout= 5000;
 
 # The first semi-sync check should be on because after slave stop,
 # there are no transactions on the master.
@@ -260,7 +261,7 @@ show status like 'Rpl_semi_sync_master_yes_tx';
 
 # Semi-sync status on master is now OFF, so all these transactions
 # will be replicated asynchronously.
-let $i=300;
+let $i=10;
 disable_query_log;
 while ($i)
 {