BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: r(dot)zharkov(at)postgrespro(dot)ru
Subject: BUG #16914: Regression test of the worker_spi fails if USE_MODULE_DB environment variable is set.
Date: 2021-03-04 07:43:11
Message-ID: 16914-ca8dd84fef8db291@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16914
Logged by: Roman Zharkov
Email address: r(dot)zharkov(at)postgrespro(dot)ru
PostgreSQL version: Unsupported/Unknown
Operating system: Centos 7
Description:

Hello!
I found a little problem with the test on the master branch:

$ make -s -C src/test/modules/worker_spi check USE_MODULE_DB=TRUE
============== creating temporary instance ==============
============== initializing database system ==============
============== starting postmaster ==============
running on port 58080 with PID 2863
============== creating database "contrib_regression_worker_spi"
==============
CREATE DATABASE
ALTER DATABASE
============== running regression test queries ==============
test worker_spi ... FAILED 131652 ms
============== shutting down postmaster

$make -s -C src/test/modules/worker_spi check USE_MODULE_DB=
============== removing existing temp instance ==============
============== creating temporary instance ==============
============== initializing database system ==============
============== starting postmaster ==============
running on port 58080 with PID 1903
============== creating database "contrib_regression" ==============
CREATE DATABASE
ALTER DATABASE
============== running regression test queries ==============
test worker_spi ... ok 246 ms
============== shutting down postmaster ==============
============== removing temporary instance ==============

=====================
All 1 tests passed.
=====================

Something like this fixes the problem:

diff --git a/src/test/modules/worker_spi/.gitignore
b/src/test/modules/worker_spi/.gitignore
index
5dcb3ff9723501c3fe639bee1c1435e47a580a6f..8050cb6716c52fbade5ac5e80eabf3dd134737b8
100644
--- a/src/test/modules/worker_spi/.gitignore
+++ b/src/test/modules/worker_spi/.gitignore
@@ -2,3 +2,4 @@
/log/
/results/
/tmp_check/
+dynamic_temp.conf
diff --git a/src/test/modules/worker_spi/Makefile
b/src/test/modules/worker_spi/Makefile
index
cbf9b2e37fd6da99b9250481f903eec1940e54ae..1865e578533eaaea8698f2396db01b4edb8a91ba
100644
--- a/src/test/modules/worker_spi/Makefile
+++ b/src/test/modules/worker_spi/Makefile
@@ -9,7 +9,15 @@ PGFILEDESC = "worker_spi - background worker example"
REGRESS = worker_spi

# enable our module in shared_preload_libraries for dynamic bgworkers
-REGRESS_OPTS = --temp-config
$(top_srcdir)/src/test/modules/worker_spi/dynamic.conf
+REGRESS_OPTS = --temp-config
$(top_srcdir)/src/test/modules/worker_spi/dynamic_temp.conf
+
+# Set the actual database name in the temp config.
+set-db-name:
+ cp $(top_srcdir)/src/test/modules/worker_spi/dynamic.conf
$(top_srcdir)/src/test/modules/worker_spi/dynamic_temp.conf
+ echo "worker_spi.database = $(CONTRIB_TESTDB)" >>
$(top_srcdir)/src/test/modules/worker_spi/dynamic_temp.conf
+.PHONY: set-db-name
+
+check: set-db-name

# Disable installcheck to ensure we cover dynamic bgworkers.
NO_INSTALLCHECK = 1

regards,
Roman Zharkov

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-03-04 11:21:05 BUG #16915: use psql have error "could not change directory to "/root": Permission denied"
Previous Message PG Bug reporting form 2021-03-04 04:13:59 BUG #16913: GENERATED AS IDENTITY column nullability is affected by order of column properties