Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bab1fd9

Browse files
committed
Avoid installcheck failure in TAP tests using injection_points
These tests depend on the test module injection_points to be installed, but it may not be available as the contents of src/test/modules/ are not installed by default. This commit adds a workaround based on a scan of pg_available_extensions to check if the extension is available, skipping the test if it is not. This allows installcheck to work transparently. There are more tests impacted by this problem on HEAD, but for now this addresses only the tests that exist on HEAD and v17 as the release is close by. Reported-by: Maxim Orlov Discussion: https://postgr.es/m/CACG=ezZkoT-pFz6a9XnyToiuR-Wg8fGELqHLoyBodr+2h-77qA@mail.gmail.com Backpatch-through: 17
1 parent ff43b5e commit bab1fd9

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/test/modules/test_misc/t/005_timeouts.pl

+12
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
my $node = PostgreSQL::Test::Cluster->new('master');
2525
$node->init();
2626
$node->start;
27+
28+
# Check if the extension injection_points is available, as it may be
29+
# possible that this script is run with installcheck, where the module
30+
# would not be installed by default.
31+
my $result = $node->safe_psql('postgres',
32+
"SELECT count(*) > 0 FROM pg_available_extensions WHERE name = 'injection_points';"
33+
);
34+
if ($result eq 'f')
35+
{
36+
plan skip_all => 'Extension injection_points not installed';
37+
}
38+
2739
$node->safe_psql('postgres', 'CREATE EXTENSION injection_points;');
2840

2941
#

src/test/recovery/t/041_checkpoint_at_promote.pl

+11
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@
3535
]);
3636
$node_primary->start;
3737

38+
# Check if the extension injection_points is available, as it may be
39+
# possible that this script is run with installcheck, where the module
40+
# would not be installed by default.
41+
my $result = $node_primary->safe_psql('postgres',
42+
"SELECT count(*) > 0 FROM pg_available_extensions WHERE name = 'injection_points';"
43+
);
44+
if ($result eq 'f')
45+
{
46+
plan skip_all => 'Extension injection_points not installed';
47+
}
48+
3849
my $backup_name = 'my_backup';
3950
$node_primary->backup($backup_name);
4051

0 commit comments

Comments
 (0)