mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
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
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user