mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 19:13:16 +08:00
Fix race condition in bgw_db_scheduler
The regression test bgw_db_scheduler tests if the BGW scheduler starts a background job after it is created. However, this only happens if the previous instance of the BGW scheduler is no longer active. If the old BGW scheduler instance is still running, it will pick up the job and prevent it from starting in the current test.
This commit is contained in:
parent
abf79f47fd
commit
ebaee6c46f
@ -276,6 +276,13 @@ SELECT application_name FROM pg_stat_activity WHERE application_name LIKE 'User-
|
||||
------------------
|
||||
(0 rows)
|
||||
|
||||
-- wait for scheduler finish
|
||||
SELECT ts_bgw_db_scheduler_test_wait_for_scheduler_finish();
|
||||
ts_bgw_db_scheduler_test_wait_for_scheduler_finish
|
||||
----------------------------------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
--
|
||||
-- Test running a normal job
|
||||
--
|
||||
|
@ -185,6 +185,9 @@ SELECT delete_job(:job_id);
|
||||
RESET client_min_messages;
|
||||
SELECT application_name FROM pg_stat_activity WHERE application_name LIKE 'User-Defined Action%';
|
||||
|
||||
-- wait for scheduler finish
|
||||
SELECT ts_bgw_db_scheduler_test_wait_for_scheduler_finish();
|
||||
|
||||
--
|
||||
-- Test running a normal job
|
||||
--
|
||||
|
Loading…
x
Reference in New Issue
Block a user