summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorElena Stepanova <elenst@montyprogram.com>2016-03-12 17:50:57 +0200
committerElena Stepanova <elenst@montyprogram.com>2016-03-12 17:50:57 +0200
commit0125e588f3967bcaf01cf60b6a64e92758158ac4 (patch)
tree79061fc0ab056545105e15e7d3d21ac9bf247aef /mysql-test
parent8103526b38391e41be4b410b52eed9ff1c2ea698 (diff)
downloadmariadb-git-0125e588f3967bcaf01cf60b6a64e92758158ac4.tar.gz
MDEV-9713 Sporadic test failure: sys_vars.innodb_buffer_pool_load_now_basic
It could have happened that one of previous tests already executed buffer pool dump and set the status variable value, so when it's been checked, the check passes too early, before the dump starts and the dump file is created. See more detailed explanation in MDEV-9713. Fixed by waiting for the current time to change in case it equals to the timestamp in the status variable, and then checking that the status variable not only matches the expected pattern, but also differs from the previous value, whatever it was.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
index fe376a3032e..160b3ba52cc 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
@@ -8,12 +8,24 @@
SET @orig = @@global.innodb_buffer_pool_load_now;
SELECT @orig;
+let $old_status= `SELECT variable_value FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`;
+
+# A previous test could have run buffer pool dump already;
+# in this case we want to make sure that the current time is different
+# from the timestamp in the status variable
+
+let $wait_condition =
+ SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
+-- source include/wait_condition.inc
+
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
# Wait for the dump to complete
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ SELECT variable_value != '$old_status'
+ AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc