From 0125e588f3967bcaf01cf60b6a64e92758158ac4 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sat, 12 Mar 2016 17:50:57 +0200 Subject: [PATCH] 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. --- .../t/innodb_buffer_pool_load_now_basic.test | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 fe376a3032ec5..160b3ba52cce6 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