Skip to content

Commit

Permalink
Fix bgw_custom flakiness by stopping bgws
Browse files Browse the repository at this point in the history
When dropping a table, we get notices if that causes to cancel
background jobs and thus fail tests. By stopping the workers
before dropping the table, we should reduce this flakiness.
  • Loading branch information
antekresic committed Sep 30, 2023
1 parent 6bef59a commit 6e4d174
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tsl/test/expected/bgw_custom.out
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,19 @@ SELECT count(*) = 0
(1 row)

-- cleanup
SELECT _timescaledb_functions.stop_background_workers();
stop_background_workers
-------------------------
t
(1 row)

DROP TABLE sensor_data;
SELECT _timescaledb_functions.restart_background_workers();
restart_background_workers
----------------------------
t
(1 row)

-- Github issue #5537
-- Proc that waits until the given job enters the expected state
CREATE OR REPLACE PROCEDURE wait_for_job_status(job_param_id INTEGER, expected_status TEXT, spins INTEGER=:TEST_SPINWAIT_ITERS)
Expand Down
2 changes: 2 additions & 0 deletions tsl/test/sql/bgw_custom.sql
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,9 @@ SELECT count(*) = 0
WHERE hypertable_name = 'sensor_data' AND NOT is_compressed;

-- cleanup
SELECT _timescaledb_functions.stop_background_workers();
DROP TABLE sensor_data;
SELECT _timescaledb_functions.restart_background_workers();

-- Github issue #5537
-- Proc that waits until the given job enters the expected state
Expand Down

0 comments on commit 6e4d174

Please sign in to comment.