Skip to content

Commit

Permalink
MDEV-13456 main.create_drop_event fails sporadically in buildbot
Browse files Browse the repository at this point in the history
Avoid race conditions between the test flow and events by waiting
for all started events to finish execution after switching off
event scheduler
  • Loading branch information
elenst committed Aug 5, 2017
1 parent 8b019f8 commit 008786a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mysql-test/t/create_drop_event.test
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 008786a

Please sign in to comment.