Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5105c90

Browse filesBrowse files
committed
Make GIN tests using injection points concurrent-safe
f587338 has introduced in the test module injection_points a SQL function called injection_points_set_local(), that can be used to make all the injection points linked to the process where they are attached, discarded automatically if any remain once the process exits. e2e3b8a has added a NO_INSTALLCHECK to the test module to prevent the use of installcheck. Now that there is a way to make the test concurrent-safe, let's use it and remove the installcheck restriction. Concurrency issues could be easily reproduced by running in a tight loop a command like this one, in src/test/modules/gin/ (hardcoding pg_sleep() after attaching injection points enlarges the race window) and a second test suite like contrib/btree_gin/: make installcheck USE_MODULE_DB=1 Reviewed-by: Andrey Borodin Discussion: https://postgr.es/m/ZhNG4Io9uYOgwv3F@paquier.xyz
1 parent 7e85d1c commit 5105c90
Copy full SHA for 5105c90

File tree

Expand file treeCollapse file tree

4 files changed

+10
-5
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-5
lines changed

‎src/test/modules/gin/Makefile

Copy file name to clipboardExpand all lines: src/test/modules/gin/Makefile
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ EXTRA_INSTALL = src/test/modules/injection_points
44

55
REGRESS = gin_incomplete_splits
66

7-
# The injection points are cluster-wide, so disable installcheck
8-
NO_INSTALLCHECK = 1
9-
107
ifdef USE_PGXS
118
PG_CONFIG = pg_config
129
PGXS := $(shell $(PG_CONFIG) --pgxs)

‎src/test/modules/gin/expected/gin_incomplete_splits.out

Copy file name to clipboardExpand all lines: src/test/modules/gin/expected/gin_incomplete_splits.out
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
-- This uses injection points to cause errors that leave some page
1313
-- splits in "incomplete" state
1414
create extension injection_points;
15+
-- Make all injection points local to this process, for concurrency.
16+
SELECT injection_points_set_local();
17+
injection_points_set_local
18+
----------------------------
19+
20+
(1 row)
21+
1522
-- Use the index for all the queries
1623
set enable_seqscan=off;
1724
-- Print a NOTICE whenever an incomplete split gets fixed

‎src/test/modules/gin/meson.build

Copy file name to clipboardExpand all lines: src/test/modules/gin/meson.build
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ tests += {
1212
'sql': [
1313
'gin_incomplete_splits',
1414
],
15-
# The injection points are cluster-wide, so disable installcheck
16-
'runningcheck': false,
1715
},
1816
}

‎src/test/modules/gin/sql/gin_incomplete_splits.sql

Copy file name to clipboardExpand all lines: src/test/modules/gin/sql/gin_incomplete_splits.sql
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
-- splits in "incomplete" state
1515
create extension injection_points;
1616

17+
-- Make all injection points local to this process, for concurrency.
18+
SELECT injection_points_set_local();
19+
1720
-- Use the index for all the queries
1821
set enable_seqscan=off;
1922

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.