Skip to content

Commit 8278edc

Browse files
author
Varun Deep Saini
committed
MDEV-38195: Fix flaky events_restart and tmp_space_usage tests
events.events_restart: Add missing error log suppressions for "error during compilation" and "Query was empty" that occur when the event scheduler processes events from a corrupted mysql.event table (body column altered to longtext). main.tmp_space_usage: The test compares tmp_space_used from session_status and processlist, but reads them at different times across a connection switch. Internal temp space changes (e.g. InnoDB page allocation) between reads cause small differences. Allow up to 32KB tolerance (two InnoDB pages) instead of requiring exact equality. Signed-off-by: Varun Deep Saini <varun.23bcs10048@ms.sst.scaler.com>
1 parent daf29b5 commit 8278edc

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

mysql-test/main/tmp_space_usage.test

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ let $tmp_usage1=`select variable_value from information_schema.session_status wh
107107
connection c1;
108108
--disable_query_log
109109
let $tmp_usage2=`select tmp_space_used from information_schema.processlist where id=$id`;
110-
if ($tmp_usage1 == $tmp_usage2)
110+
# The two values are read at slightly different times, so they may differ
111+
# by a small amount due to internal temp space changes between reads.
112+
let $diff=`select abs(cast('$tmp_usage1' as signed) - cast('$tmp_usage2' as signed))`;
113+
if ($diff <= 32768)
111114
{
112115
--echo # information_schema.process_list.tmp_space_used == status.tmp_space_used
113116
}
114-
if ($tmp_usage1 != $tmp_usage2)
117+
if ($diff > 32768)
115118
{
116119
--echo tmp_space_used difference: $tmp_usage1 != $tmp_usage2
117120
}

mysql-test/suite/events/events_restart.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
call mtr.add_suppression('Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted');
55
call mtr.add_suppression('Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler');
66
call mtr.add_suppression('Event Scheduler.*shutdown.*');
7+
call mtr.add_suppression('Event Scheduler: error during compilation of');
8+
call mtr.add_suppression('Event Scheduler:.*Query was empty');
79
--enable_query_log
810

911
let $collation_server=`select @@collation_server`;

0 commit comments

Comments
 (0)