003_check_guc.pl crashes if some extensions were loaded.

From: "Anton A(dot) Melnikov" <a(dot)melnikov(at)postgrespro(dot)ru>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: 003_check_guc.pl crashes if some extensions were loaded.
Date: 2023-11-01 21:28:05
Message-ID: fc5509ce-5144-4dac-8d13-21793da44fc5@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v0-0001-Exclude-extGUCs-from-003_check_guc.patch text/x-patch 815 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-11-01 21:37:14 Re: GUC names in messages
Previous Message John Morris 2023-11-01 21:15:20 Re: Atomic ops for unlogged LSN