From: Michael Paquier <michael@paquier.xyz>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add hooks for session start and session end, take two
Date: Wed, 2 Oct 2019 08:53:06 +0900
Message-ID: <20191001235306.GA3130@paquier.xyz> (raw)
In-Reply-To: <97f71fee-4068-c0be-342d-146cfac70bbb@2ndQuadrant.com>
References: <E1iF8dy-0000fc-9S@gemulon.postgresql.org>
<20191001045246.GF2781@paquier.xyz>
<20191001052245.GH2781@paquier.xyz>
<20191001071320.GJ2781@paquier.xyz>
<20191001142816.GA25272@paquier.xyz>
<97f71fee-4068-c0be-342d-146cfac70bbb@2ndQuadrant.com>
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
Attachments:session-hook-test-fix.patch (text/x-diff, 2.8K) downloaddiff --git a/src/test/modules/test_session_hooks/Makefile b/src/test/modules/test_session_hooks/Makefileindex 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.outindex 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.sqlindex 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 (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: michael@paquier.xyz, andrew.dunstan@2ndquadrant.com, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add hooks for session start and session end, take two
In-Reply-To: <20191001235306.GA3130@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox