You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: sql_task.sql BVT is flaky because scheduled SQL task run races with manual-run assertions #24249
test/distributed/cases/task/sql_task.sql occasionally fails in CI. The case expects the latest sql_task_cron run to be MANUAL, but CI sometimes observes a newer SCHEDULED run instead. The extra scheduled execution also inserts one more row into scheduled_events, so the expected count 2 becomes 3.
Expected Behavior
sql_task.sql should be deterministic in CI. The section that validates manual EXECUTE TASK behavior should not be affected by background scheduled executions, and the latest run/count assertions should consistently match the expected result.
Steps to Reproduce
Run test/distributed/cases/task/sql_task.sql in CI or a slow local environment.
The case creates sql_task_cron, then changes its schedule to every second:
alter task sql_task_cron set schedule '*/1 * * * * *' timezone 'UTC';
The test immediately executes the task manually and asserts exact run/count results:
execute task sql_task_cron;
select sleep(1);
show task runs for sql_task_cron limit 1;
...
execute task sql_task_cron;
select sleep(1);
select count(*) from scheduled_events;
On slower runners, the async scheduled-run pipeline can land a SCHEDULED run during the assertion window, causing show task runs ... limit 1 to return SCHEDULED and scheduled_events to contain one extra row.
Activity
test: stabilize sql task cron case (#24251)