Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flake pg_dump regression test #3636

Closed

Conversation

fabriziomello
Copy link
Contributor

Randomly we face problems executing pg_dump regression tests and the
commom failure is due to a DROP DATABASE.

Fixed id executing pg_terminate_backend over all active sessions for
the target database before issue the DROP DATABASE command.

@fabriziomello fabriziomello self-assigned this Oct 1, 2021
@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #3636 (5da1787) into master (ef0ff45) will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3636      +/-   ##
==========================================
- Coverage   90.82%   90.78%   -0.04%     
==========================================
  Files         212      212              
  Lines       36534    36533       -1     
==========================================
- Hits        33182    33167      -15     
- Misses       3352     3366      +14     
Impacted Files Coverage Δ
src/bgw/scheduler.c 83.04% <0.00%> (-3.51%) ⬇️
src/bgw/job.c 91.97% <0.00%> (-0.34%) ⬇️
tsl/src/nodes/data_node_dispatch.c 97.10% <0.00%> (-0.25%) ⬇️
tsl/src/bgw_policy/job.c 96.85% <0.00%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef0ff45...5da1787. Read the comment docs.

@fabriziomello fabriziomello force-pushed the fix_flake_pg_dump_test branch 2 times, most recently from 99da6cb to 38c9615 Compare October 4, 2021 12:36
@fabriziomello fabriziomello marked this pull request as ready for review October 4, 2021 12:37
@fabriziomello fabriziomello requested a review from a team as a code owner October 4, 2021 12:37
@fabriziomello fabriziomello requested review from pmwkaa, afiskon and nikkhils and removed request for a team October 4, 2021 12:37
@svenklemm
Copy link
Member

I do not think your change will do anything. Most often the error is about the template database being accessed.
See: https://github.com/timescale/timescaledb/runs/3789743484?check_suite_focus=true for an example of a failed run

@fabriziomello
Copy link
Contributor Author

fabriziomello commented Oct 4, 2021

I do not think your change will do anything. Most often the error is about the template database being accessed. See: https://github.com/timescale/timescaledb/runs/3789743484?check_suite_focus=true for an example of a failed run

You're correct, the error I'm getting time to time is the following:

diff -u /Users/runner/work/timescaledb/timescaledb/test/expected/pg_dump.out /Users/runner/work/timescaledb/timescaledb/build/test/results/pg_dump.out
--- /Users/runner/work/timescaledb/timescaledb/test/expected/pg_dump.out	2021-10-04 12:34:50.000000000 +0000
+++ /Users/runner/work/timescaledb/timescaledb/build/test/results/pg_dump.out	2021-10-04 12:45:01.000000000 +0000
@@ -601,14 +601,4 @@
 (0 rows)
 
 CREATE DATABASE db_dump_error WITH TEMPLATE :TEST_DBNAME;
---now test functions for permission errors
-\c  db_dump_error :ROLE_DEFAULT_PERM_USER_2
-\set ON_ERROR_STOP 0
-SELECT timescaledb_pre_restore();
-ERROR:  must be owner of database db_dump_error
-SELECT timescaledb_post_restore();
-ERROR:  must be owner of database db_dump_error
-\set ON_ERROR_STOP 1
---drop db
-\c :TEST_DBNAME :ROLE_SUPERUSER
-DROP DATABASE db_dump_error;
+ERROR:  source database "db_pg_dump" is being accessed by other users

Is db_pg_dump the template database you're talking about?

@fabriziomello fabriziomello force-pushed the fix_flake_pg_dump_test branch 5 times, most recently from a80e21f to 21fab81 Compare October 4, 2021 18:24
Randomly we face problems executing `pg_dump` regression tests and the
commom failure is due to a `CREATE DATABASE .. WITH TEMPLATE`.

Fixed id executing `pg_terminate_backend` over all active sessions for
the templatet database (again) before issue the `CREATE DATABASE`
command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants