postgres.git / summary / log / commit / refs
commit c61c3ec40cb8e08fe54573de7cf1a27fa4d10f9f
Author: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: Tue Aug 18 20:25:55 2026 +0000
First released in: 19.0
Minor test suite cleanup
A few catalog queries were missing proper schema qualification in the
test_checksums module test suites, and one suite contained a disable
call right before tearing down the test which can be removed.
Backpatch to v19 where the test suite was added.
Author: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/8CF9B235-AEE9-4E68-93DD-DF4F29E2FCE5@yesql.se
Backpatch-through: 19
src/test/modules/test_checksums/t/001_basic.pl | 4 ++--
src/test/modules/test_checksums/t/002_restarts.pl | 4 +---
src/test/modules/test_checksums/t/003_standby_restarts.pl | 7 ++++---
src/test/modules/test_checksums/t/005_injection.pl | 5 +++--
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/test/modules/test_checksums/t/001_basic.pl b/src/test/modules/test_checksums/t/001_basic.pl
index 5a16b6fb9e4..4cfa35b6885 100644
--- a/src/test/modules/test_checksums/t/001_basic.pl
+++ b/src/test/modules/test_checksums/t/001_basic.pl
@@ -136,7 +136,7 @@ enable_data_checksums($node);
$node->poll_query_until(
'postgres', qq[
- SELECT count(*) > 0 FROM pg_stat_activity
+ SELECT count(*) > 0 FROM pg_catalog.pg_stat_activity
WHERE backend_type = 'datachecksums worker' AND datname = 'postgres'
AND query LIKE 'Waiting for % temp tables to be removed']
) or die "timed out waiting for worker to wait for temporary tables";
@@ -180,7 +180,7 @@ enable_data_checksums($node);
$node->poll_query_until(
'postgres', qq[
- SELECT count(*) > 0 FROM pg_stat_activity
+ SELECT count(*) > 0 FROM pg_catalog.pg_stat_activity
WHERE backend_type = 'datachecksums worker' AND datname = 'dropmeforce'
AND query LIKE 'Waiting for % temp tables to be removed']
) or die "timed out waiting for worker to wait for temporary tables";
diff --git a/src/test/modules/test_checksums/t/002_restarts.pl b/src/test/modules/test_checksums/t/002_restarts.pl
index bef0bb90993..4799afed628 100644
--- a/src/test/modules/test_checksums/t/002_restarts.pl
+++ b/src/test/modules/test_checksums/t/002_restarts.pl
@@ -152,11 +152,9 @@ is($result, '9999', 'ensure checksummed pages can be read back');
$result = $node->poll_query_until(
'postgres',
- "SELECT count(*) FROM pg_stat_activity WHERE backend_type LIKE 'datachecksums%';",
+ "SELECT count(*) FROM pg_catalog.pg_stat_activity WHERE backend_type LIKE 'datachecksums%';",
'0');
is($result, 1, 'await datachecksums worker/launcher termination');
-disable_data_checksums($node, wait => 1);
-
$node->stop;
done_testing();
diff --git a/src/test/modules/test_checksums/t/003_standby_restarts.pl b/src/test/modules/test_checksums/t/003_standby_restarts.pl
index bb35ed0b325..b05ffd8643a 100644
--- a/src/test/modules/test_checksums/t/003_standby_restarts.pl
+++ b/src/test/modules/test_checksums/t/003_standby_restarts.pl
@@ -95,7 +95,7 @@ is($result, '19998', 'ensure we can safely read all data with checksums');
$result = $node_primary->poll_query_until(
'postgres',
- "SELECT count(*) FROM pg_stat_activity WHERE backend_type LIKE 'datachecksums%';",
+ "SELECT count(*) FROM pg_catalog.pg_stat_activity WHERE backend_type LIKE 'datachecksums%';",
'0');
is($result, 1, 'await datachecksums worker/launcher termination');
@@ -145,9 +145,10 @@ $node_primary->wait_for_catchup($node_standby, 'replay',
# Get the relfilenode and database OID so we can inspect the filesystem
my $unlogged_rfn = $node_primary->safe_psql('postgres',
- "SELECT relfilenode FROM pg_class WHERE relname = 'unlogged_tbl';");
+ "SELECT relfilenode FROM pg_catalog.pg_class WHERE relname = 'unlogged_tbl';"
+);
my $db_oid = $node_primary->safe_psql('postgres',
- "SELECT oid FROM pg_database WHERE datname = 'postgres';");
+ "SELECT oid FROM pg_catalog.pg_database WHERE datname = 'postgres';");
# Verify the standby only has the init fork (no main fork)
my $standby_datadir = $node_standby->data_dir;
diff --git a/src/test/modules/test_checksums/t/005_injection.pl b/src/test/modules/test_checksums/t/005_injection.pl
index 60bb716d922..92a4948f040 100644
--- a/src/test/modules/test_checksums/t/005_injection.pl
+++ b/src/test/modules/test_checksums/t/005_injection.pl
@@ -98,7 +98,7 @@ my $dropdb_log_offset = -s $node->logfile;
enable_data_checksums($node);
$node->poll_query_until(
'postgres', qq[
- SELECT count(*) > 0 FROM pg_stat_activity
+ SELECT count(*) > 0 FROM pg_catalog.pg_stat_activity
WHERE backend_type = 'datachecksums worker' AND datname = 'postgres'
AND query LIKE 'Waiting for % temp tables to be removed']
) or die "timed out waiting for worker to wait for temporary tables";
@@ -125,7 +125,8 @@ $node->safe_psql('postgres',
"SELECT injection_points_detach('dropdb-after-invalid-marker');");
my $invalid_state = $node->safe_psql('postgres',
- "SELECT datconnlimit FROM pg_database WHERE datname = 'invalid_dropdb';");
+ "SELECT datconnlimit FROM pg_catalog.pg_database WHERE datname = 'invalid_dropdb';"
+);
is($invalid_state, '-2', 'interrupted DROP left an invalid database row');
# Let checksum processing continue. The invalid database must be treated as
[parent: 0907112d3882]