Commit 008786ae authored by Elena Stepanova's avatar Elena Stepanova

MDEV-13456 main.create_drop_event fails sporadically in buildbot

Avoid race conditions between the test flow and events by waiting
for all started events to finish execution after switching off
event scheduler
parent 8b019f87
......@@ -10,11 +10,13 @@ CREATE OR REPLACE EVENT IF NOT EXISTS ev1 ON SCHEDULE EVERY 1 SECOND DO DROP DAT
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
SELECT EVENT_NAME, EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
--source include/count_sessions.inc
SET GLOBAL event_scheduler=on;
let $wait_condition= SELECT count(*)>0 FROM t1;
--source include/wait_condition.inc
SELECT DISTINCT a FROM t1;
SET GLOBAL event_scheduler=off;
--source include/wait_until_count_sessions.inc
DELETE FROM t1;
--error ER_EVENT_ALREADY_EXISTS
......@@ -30,6 +32,7 @@ let $wait_condition= SELECT count(*)>0 FROM t1;
--source include/wait_condition.inc
SELECT DISTINCT a FROM t1;
SET GLOBAL event_scheduler=off;
--source include/wait_until_count_sessions.inc
DELETE FROM t1;
DROP EVENT IF EXISTS ev1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment