public inbox for [email protected]  
help / color / mirror / Atom feed
From: Anton A. Melnikov <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: 003_check_guc.pl crashes if some extensions were loaded.
Date: Thu, 2 Nov 2023 00:28:05 +0300
Message-ID: <[email protected]> (raw)

Hello!

Found that src/test/modules/test_misc/t/003_check_guc.pl will crash if an extension
that adds own GUCs was loaded into memory.
So it is now impossible to run a check-world with loaded extension libraries.

Reproduction:
cd src/test/modules/test_misc
export EXTRA_INSTALL="contrib/pg_stat_statements"
export TEMP_CONFIG=$(pwd)/pg_stat_statements_temp.conf
echo -e "shared_preload_libraries = 'pg_stat_statements'" > $TEMP_CONFIG
echo "compute_query_id = 'regress'" >> $TEMP_CONFIG
make check PROVE_TESTS='t/003_check_guc.pl'

# +++ tap check in src/test/modules/test_misc +++
t/003_check_guc.pl .. 1/?
#   Failed test 'no parameters missing from postgresql.conf.sample'
#   at t/003_check_guc.pl line 81.
#          got: '5'
#     expected: '0'
# Looks like you failed 1 test of 3.

Maybe exclude such GUCs from this test?
For instance, like that:

--- a/src/test/modules/test_misc/t/003_check_guc.pl
+++ b/src/test/modules/test_misc/t/003_check_guc.pl
@@ -19,7 +19,7 @@ my $all_params = $node->safe_psql(
         "SELECT name
       FROM pg_settings
     WHERE NOT 'NOT_IN_SAMPLE' = ANY (pg_settings_get_flags(name)) AND
-       name <> 'config_file'
+       name <> 'config_file' AND name NOT LIKE '%.%'
       ORDER BY 1");

With the best wishes,

-- 
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachments:

  [text/x-patch] v0-0001-Exclude-extGUCs-from-003_check_guc.patch (815B, ../[email protected]/2-v0-0001-Exclude-extGUCs-from-003_check_guc.patch)
  download | inline diff:
commit 91c84d50ba4b1c75749e4c160e1d4a25ca684fda
Author: Anton A. Melnikov <[email protected]>
Date:   Wed Nov 1 23:58:19 2023 +0300

    Exclude extensions' GUCs from the 003_check_guc.pl

diff --git a/src/test/modules/test_misc/t/003_check_guc.pl b/src/test/modules/test_misc/t/003_check_guc.pl
index 4fd6d03b9e..63fcd754de 100644
--- a/src/test/modules/test_misc/t/003_check_guc.pl
+++ b/src/test/modules/test_misc/t/003_check_guc.pl
@@ -19,7 +19,7 @@ my $all_params = $node->safe_psql(
 	"SELECT name
      FROM pg_settings
    WHERE NOT 'NOT_IN_SAMPLE' = ANY (pg_settings_get_flags(name)) AND
-       name <> 'config_file'
+       name <> 'config_file' AND name NOT LIKE '%.%'
      ORDER BY 1");
 # Note the lower-case conversion, for consistency.
 my @all_params_array = split("\n", lc($all_params));


view thread (3+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: 003_check_guc.pl crashes if some extensions were loaded.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox