MDEV-33965 - fix non-determinism in the main.status test

Change the order or queries, so that result of "uptime_since_flush"
comparison does not depend on timing.

Also, improve the execution speed of the test by ca. 25 percent, removing
or reducing the sleeps. There is no need to sleep more than 1 second
in this test.
This commit is contained in:
Vladislav Vaintroub 2025-02-05 15:28:42 +01:00
parent 1c4aed7c68
commit d54ec1b377
2 changed files with 6 additions and 8 deletions

View File

@ -481,7 +481,7 @@ flush session status;
select $new_global_flush_status >= $global_flush_status as "1";
1
1
select $new_local_flush_status < $global_flush_status as "1";
select $new_local_flush_status < $new_global_flush_status as "1";
1
1
flush global status;

View File

@ -480,23 +480,21 @@ connection default;
flush global status;
flush session status;
--sleep 1
let $global_flush_status= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'Uptime_since_flush_status'`;
let $local_flush_status= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'Uptime_since_flush_status'`;
let $global_flush_status= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'Uptime_since_flush_status'`;
--sleep 2
--sleep 1
--evalp select $global_flush_status >= $local_flush_status as "1"
flush session status;
let $new_global_flush_status= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'Uptime_since_flush_status'`;
let $new_local_flush_status= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'Uptime_since_flush_status'`;
let $new_global_flush_status= `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'Uptime_since_flush_status'`;
--evalp select $new_global_flush_status >= $global_flush_status as "1"
--evalp select $new_local_flush_status < $global_flush_status as "1"
--evalp select $new_local_flush_status < $new_global_flush_status as "1"
--sleep 2
--sleep 1
flush global status;
let $local_flush_status=$new_local_flush_status;