On Tue, Oct 01, 2019 at 03:24:21PM -0400, Andrew Dunstan wrote: > I'll fix up the logging. Meanwhile, the log is showing: > > \c :prevdb regress_sess_hook_usr1 > \connect: FATAL: SSPI authentication failed for user > "regress_sess_hook_usr1" > > That's not surprising given the hba and ident file contents.
Thanks for the details of the logs! That makes sense, and we actually do not have other modules with NO_INSTALLCHECK which use \c to reconnect in a test. The attached patch should be able to fix the issue. Could you confirm? -- Michael
diff --git a/src/test/modules/test_session_hooks/Makefile b/src/test/modules/test_session_hooks/Makefile index e8ba6990f6..f6ecf76ce5 100644 --- a/src/test/modules/test_session_hooks/Makefile +++ b/src/test/modules/test_session_hooks/Makefile @@ -5,7 +5,7 @@ OBJS = test_session_hooks.o $(WIN32RES) PGFILEDESC = "test_session_hooks - tests for start and end session hooks" REGRESS = test_session_hooks -REGRESS_OPTS = --temp-config=$(top_srcdir)/src/test/modules/test_session_hooks/session_hooks.conf +REGRESS_OPTS = --create-role=regress_sess_hook_usr1,regress_sess_hook_usr2 --temp-config=$(top_srcdir)/src/test/modules/test_session_hooks/session_hooks.conf # Disabled because these tests require extra configuration with # "shared_preload_libraries=test_session_hooks", which typical # installcheck users do not have (e.g. buildfarm clients). diff --git a/src/test/modules/test_session_hooks/expected/test_session_hooks.out b/src/test/modules/test_session_hooks/expected/test_session_hooks.out index 120dcc9a11..a5a93a8c39 100644 --- a/src/test/modules/test_session_hooks/expected/test_session_hooks.out +++ b/src/test/modules/test_session_hooks/expected/test_session_hooks.out @@ -2,8 +2,8 @@ -- Tests for start and end session hooks -- -- Only activity from role regress_sess_hook_usr2 is logged. -CREATE ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; -CREATE ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; \set prevdb :DBNAME \set prevusr :USER CREATE TABLE session_hook_log(id SERIAL, dbname TEXT, username TEXT, hook_at TEXT); @@ -33,5 +33,3 @@ SELECT * FROM session_hook_log ORDER BY id; 2 | contrib_regression | regress_sess_hook_usr2 | END (2 rows) -DROP ROLE regress_sess_hook_usr1; -DROP ROLE regress_sess_hook_usr2; diff --git a/src/test/modules/test_session_hooks/sql/test_session_hooks.sql b/src/test/modules/test_session_hooks/sql/test_session_hooks.sql index 1cc06f613b..f041c8bed8 100644 --- a/src/test/modules/test_session_hooks/sql/test_session_hooks.sql +++ b/src/test/modules/test_session_hooks/sql/test_session_hooks.sql @@ -3,8 +3,8 @@ -- -- Only activity from role regress_sess_hook_usr2 is logged. -CREATE ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; -CREATE ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr1 SUPERUSER LOGIN; +ALTER ROLE regress_sess_hook_usr2 SUPERUSER LOGIN; \set prevdb :DBNAME \set prevusr :USER CREATE TABLE session_hook_log(id SERIAL, dbname TEXT, username TEXT, hook_at TEXT); @@ -15,5 +15,3 @@ SELECT * FROM session_hook_log ORDER BY id; SELECT * FROM session_hook_log ORDER BY id; \c :prevdb :prevusr SELECT * FROM session_hook_log ORDER BY id; -DROP ROLE regress_sess_hook_usr1; -DROP ROLE regress_sess_hook_usr2;
signature.asc
Description: PGP signature
