timescaledb icon indicating copy to clipboard operation
timescaledb copied to clipboard

[Flaky test] Race condition in bgw_launcher

Open mkindahl opened this issue 1 year ago • 1 comments

Which test is flaky?

bgw_launcher

Since when has the test been flaky?

November 16, 2023

Link to the failed test run

https://github.com/timescale/timescaledb/actions/runs/6890326254/job/18743143594?pr=6316

Log output

diff -u /home/runner/work/timescaledb/timescaledb/test/expected/bgw_launcher.out /home/runner/work/timescaledb/timescaledb/build/test/results/bgw_launcher.out
--- /home/runner/work/timescaledb/timescaledb/test/expected/bgw_launcher.out	2023-11-16 11:53:42.145286429 +0000
+++ /home/runner/work/timescaledb/timescaledb/build/test/results/bgw_launcher.out	2023-11-16 11:57:52.842875690 +0000
@@ -612,6 +612,4 @@
 -- Change tablespace
 ALTER DATABASE :TEST_DBNAME SET TABLESPACE tablespace1;
 WARNING:  you may need to manually restart any running background workers after this command
--- tear down test and clean up additional database
-\c :TEST_DBNAME :ROLE_SUPERUSER
-DROP DATABASE :TEST_DBNAME_2 WITH (force);
+ERROR:  database "db_bgw_launcher" is being accessed by other users

Reason for flakiness

Other connections (probably from background workers) are not shutting down fast enough, leading to a race condition.

mkindahl avatar Nov 16 '23 12:11 mkindahl

Still flaky https://github.com/timescale/timescaledb/actions/runs/7008273177/job/19064241668?pr=6347

fabriziomello avatar Nov 27 '23 18:11 fabriziomello