Skip to content

Commit 0125e58

Browse files
committed
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.
1 parent 8103526 commit 0125e58

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,24 @@
88
SET @orig = @@global.innodb_buffer_pool_load_now;
99
SELECT @orig;
1010

11+
let $old_status= `SELECT variable_value FROM information_schema.global_status
12+
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`;
13+
14+
# A previous test could have run buffer pool dump already;
15+
# in this case we want to make sure that the current time is different
16+
# from the timestamp in the status variable
17+
18+
let $wait_condition =
19+
SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
20+
-- source include/wait_condition.inc
21+
1122
# Do the dump
1223
SET GLOBAL innodb_buffer_pool_dump_now = ON;
1324

1425
# Wait for the dump to complete
1526
let $wait_condition =
16-
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
27+
SELECT variable_value != '$old_status'
28+
AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
1729
FROM information_schema.global_status
1830
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
1931
-- source include/wait_condition.inc

0 commit comments

Comments
 (0)