summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorDaniel Gustafsson2022-02-11 19:54:44 +0000
committerDaniel Gustafsson2022-02-11 19:54:44 +0000
commit549ec201d6132b7c7ee11ee90a4e02119259ba5b (patch)
tree44c1669ef24c66233c16b2fa77aff148596f67a7 /src/test
parent751b8d23b788580bbff7463e3959f9a92a95b28a (diff)
Replace Test::More plans with done_testing
Rather than doing manual book keeping to plan the number of tests to run in each TAP suite, conclude each run with done_testing() summing up the the number of tests that ran. This removes the need for maintaning and updating the plan count at the expense of an accurate count of remaining during the test suite runtime. This patch has been discussed a number of times, often in the context of other patches which updates tests, so a larger number of discussions can be found in the archives. Reviewed-by: Julien Rouhaud <rjuju123@gmail.com> Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Michael Paquier <michael@paquier.xyz> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://postgr.es/m/DD399313-3D56-4666-8079-88949DAC870F@yesql.se
Diffstat (limited to 'src/test')
-rw-r--r--src/test/authentication/t/001_password.pl7
-rw-r--r--src/test/authentication/t/002_saslprep.pl6
-rw-r--r--src/test/kerberos/t/001_auth.pl8
-rw-r--r--src/test/ldap/t/001_auth.pl8
-rw-r--r--src/test/modules/brin/t/01_workitems.pl4
-rw-r--r--src/test/modules/commit_ts/t/001_base.pl4
-rw-r--r--src/test/modules/commit_ts/t/002_standby.pl4
-rw-r--r--src/test/modules/commit_ts/t/003_standby_2.pl4
-rw-r--r--src/test/modules/commit_ts/t/004_restart.pl4
-rw-r--r--src/test/modules/test_misc/t/001_constraint_validation.pl4
-rw-r--r--src/test/modules/test_misc/t/002_tablespace.pl4
-rw-r--r--src/test/modules/test_misc/t/003_check_guc.pl4
-rw-r--r--src/test/modules/test_pg_dump/t/001_base.pl40
-rw-r--r--src/test/perl/README7
-rw-r--r--src/test/recovery/t/001_stream_rep.pl4
-rw-r--r--src/test/recovery/t/002_archiving.pl4
-rw-r--r--src/test/recovery/t/003_recovery_targets.pl4
-rw-r--r--src/test/recovery/t/004_timeline_switch.pl4
-rw-r--r--src/test/recovery/t/005_replay_delay.pl4
-rw-r--r--src/test/recovery/t/006_logical_decoding.pl4
-rw-r--r--src/test/recovery/t/007_sync_rep.pl4
-rw-r--r--src/test/recovery/t/008_fsm_truncation.pl4
-rw-r--r--src/test/recovery/t/009_twophase.pl4
-rw-r--r--src/test/recovery/t/010_logical_decoding_timelines.pl4
-rw-r--r--src/test/recovery/t/011_crash_recovery.pl4
-rw-r--r--src/test/recovery/t/012_subtransactions.pl4
-rw-r--r--src/test/recovery/t/013_crash_restart.pl5
-rw-r--r--src/test/recovery/t/014_unlogged_reinit.pl4
-rw-r--r--src/test/recovery/t/015_promotion_pages.pl4
-rw-r--r--src/test/recovery/t/016_min_consistency.pl4
-rw-r--r--src/test/recovery/t/017_shm.pl6
-rw-r--r--src/test/recovery/t/018_wal_optimize.pl4
-rw-r--r--src/test/recovery/t/019_replslot_limit.pl4
-rw-r--r--src/test/recovery/t/020_archive_status.pl4
-rw-r--r--src/test/recovery/t/021_row_visibility.pl4
-rw-r--r--src/test/recovery/t/022_crash_temp_files.pl7
-rw-r--r--src/test/recovery/t/023_pitr_prepared_xact.pl4
-rw-r--r--src/test/recovery/t/024_archive_recovery.pl4
-rw-r--r--src/test/recovery/t/025_stuck_on_old_timeline.pl4
-rw-r--r--src/test/recovery/t/026_overwrite_contrecord.pl4
-rw-r--r--src/test/recovery/t/027_stream_regress.pl6
-rw-r--r--src/test/ssl/t/001_ssltests.pl6
-rw-r--r--src/test/ssl/t/002_scram.pl4
-rw-r--r--src/test/ssl/t/003_sslinfo.pl6
-rw-r--r--src/test/subscription/t/001_rep_changes.pl4
-rw-r--r--src/test/subscription/t/002_types.pl4
-rw-r--r--src/test/subscription/t/003_constraints.pl4
-rw-r--r--src/test/subscription/t/004_sync.pl4
-rw-r--r--src/test/subscription/t/005_encoding.pl4
-rw-r--r--src/test/subscription/t/006_rewrite.pl4
-rw-r--r--src/test/subscription/t/007_ddl.pl4
-rw-r--r--src/test/subscription/t/008_diff_schema.pl4
-rw-r--r--src/test/subscription/t/009_matviews.pl4
-rw-r--r--src/test/subscription/t/010_truncate.pl4
-rw-r--r--src/test/subscription/t/011_generated.pl4
-rw-r--r--src/test/subscription/t/012_collation.pl8
-rw-r--r--src/test/subscription/t/013_partition.pl4
-rw-r--r--src/test/subscription/t/014_binary.pl4
-rw-r--r--src/test/subscription/t/015_stream.pl4
-rw-r--r--src/test/subscription/t/016_stream_subxact.pl4
-rw-r--r--src/test/subscription/t/017_stream_ddl.pl4
-rw-r--r--src/test/subscription/t/018_stream_subxact_abort.pl4
-rw-r--r--src/test/subscription/t/019_stream_subxact_ddl_abort.pl4
-rw-r--r--src/test/subscription/t/020_messages.pl4
-rw-r--r--src/test/subscription/t/021_twophase.pl4
-rw-r--r--src/test/subscription/t/022_twophase_cascade.pl4
-rw-r--r--src/test/subscription/t/023_twophase_stream.pl4
-rw-r--r--src/test/subscription/t/024_add_drop_pub.pl4
-rw-r--r--src/test/subscription/t/025_rep_changes_for_schema.pl4
-rw-r--r--src/test/subscription/t/026_worker_stats.pl4
-rw-r--r--src/test/subscription/t/027_nosuperuser.pl4
-rw-r--r--src/test/subscription/t/100_bugs.pl4
72 files changed, 205 insertions, 151 deletions
diff --git a/src/test/authentication/t/001_password.pl b/src/test/authentication/t/001_password.pl
index 5d56455857..3e3079c824 100644
--- a/src/test/authentication/t/001_password.pl
+++ b/src/test/authentication/t/001_password.pl
@@ -18,11 +18,6 @@ if (!$use_unix_sockets)
plan skip_all =>
"authentication tests cannot run without Unix-domain sockets";
}
-else
-{
- plan tests => 23;
-}
-
# Delete pg_hba.conf from the given node, add a new entry to it
# and then execute a reload to refresh it.
@@ -160,3 +155,5 @@ append_to_file(
!);
test_role($node, 'md5_role', 'password from pgpass', 0);
+
+done_testing();
diff --git a/src/test/authentication/t/002_saslprep.pl b/src/test/authentication/t/002_saslprep.pl
index d8995b1ae5..5e87e21ee9 100644
--- a/src/test/authentication/t/002_saslprep.pl
+++ b/src/test/authentication/t/002_saslprep.pl
@@ -15,10 +15,6 @@ if (!$use_unix_sockets)
plan skip_all =>
"authentication tests cannot run without Unix-domain sockets";
}
-else
-{
- plan tests => 12;
-}
# Delete pg_hba.conf from the given node, add a new entry to it
# and then execute a reload to refresh it.
@@ -117,3 +113,5 @@ test_login($node, 'saslpreptest6_role', "foobar", 2);
test_login($node, 'saslpreptest7_role', "foo\xd8\xa71bar", 0);
test_login($node, 'saslpreptest7_role', "foo1\xd8\xa7bar", 2);
test_login($node, 'saslpreptest7_role', "foobar", 2);
+
+done_testing();
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index 2b539d2402..62e0542639 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -21,11 +21,7 @@ use PostgreSQL::Test::Cluster;
use Test::More;
use Time::HiRes qw(usleep);
-if ($ENV{with_gssapi} eq 'yes')
-{
- plan tests => 44;
-}
-else
+if ($ENV{with_gssapi} ne 'yes')
{
plan skip_all => 'GSSAPI/Kerberos not supported by this build';
}
@@ -399,3 +395,5 @@ test_access(
'',
'fails with wrong krb_realm, but still authenticates',
"connection authenticated: identity=\"test1\@$realm\" method=gss");
+
+done_testing();
diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl
index cdc4e1e5c8..094270cb5d 100644
--- a/src/test/ldap/t/001_auth.pl
+++ b/src/test/ldap/t/001_auth.pl
@@ -7,11 +7,7 @@ use PostgreSQL::Test::Utils;
use PostgreSQL::Test::Cluster;
use Test::More;
-if ($ENV{with_ldap} eq 'yes')
-{
- plan tests => 28;
-}
-else
+if ($ENV{with_ldap} ne 'yes')
{
plan skip_all => 'LDAP not supported by this build';
}
@@ -367,3 +363,5 @@ $node->restart;
$ENV{"PGPASSWORD"} = 'secret1';
test_access($node, 'test1', 2, 'bad combination of LDAPS and StartTLS');
+
+done_testing();
diff --git a/src/test/modules/brin/t/01_workitems.pl b/src/test/modules/brin/t/01_workitems.pl
index 2c9a206ae5..3108c02cf4 100644
--- a/src/test/modules/brin/t/01_workitems.pl
+++ b/src/test/modules/brin/t/01_workitems.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Utils;
-use Test::More tests => 2;
+use Test::More;
use PostgreSQL::Test::Cluster;
my $node = PostgreSQL::Test::Cluster->new('tango');
@@ -42,3 +42,5 @@ $count = $node->safe_psql('postgres',
);
is($count, 't', "index got summarized");
$node->stop;
+
+done_testing();
diff --git a/src/test/modules/commit_ts/t/001_base.pl b/src/test/modules/commit_ts/t/001_base.pl
index 52fca03ddb..3f0bb9e858 100644
--- a/src/test/modules/commit_ts/t/001_base.pl
+++ b/src/test/modules/commit_ts/t/001_base.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Utils;
-use Test::More tests => 2;
+use Test::More;
use PostgreSQL::Test::Cluster;
my $node = PostgreSQL::Test::Cluster->new('foxtrot');
@@ -34,3 +34,5 @@ my $recovered_ts = $node->safe_psql('postgres',
'select ts.* from pg_class, pg_xact_commit_timestamp(xmin) ts where relname = \'t\''
);
is($recovered_ts, $ts, 'commit TS remains after crash recovery');
+
+done_testing();
diff --git a/src/test/modules/commit_ts/t/002_standby.pl b/src/test/modules/commit_ts/t/002_standby.pl
index c8791f5b0e..ace31405e6 100644
--- a/src/test/modules/commit_ts/t/002_standby.pl
+++ b/src/test/modules/commit_ts/t/002_standby.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Utils;
-use Test::More tests => 4;
+use Test::More;
use PostgreSQL::Test::Cluster;
my $bkplabel = 'backup';
@@ -64,3 +64,5 @@ like(
$standby_ts_stderr,
qr/could not get commit timestamp data/,
'expected error when primary turned feature off');
+
+done_testing();
diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl
index b53ca4f8de..16d5f13009 100644
--- a/src/test/modules/commit_ts/t/003_standby_2.pl
+++ b/src/test/modules/commit_ts/t/003_standby_2.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Utils;
-use Test::More tests => 4;
+use Test::More;
use PostgreSQL::Test::Cluster;
my $bkplabel = 'backup';
@@ -65,3 +65,5 @@ my $standby_ts = $standby->safe_psql('postgres',
);
isnt($standby_ts, '',
"standby gives valid value ($standby_ts) after promotion");
+
+done_testing();
diff --git a/src/test/modules/commit_ts/t/004_restart.pl b/src/test/modules/commit_ts/t/004_restart.pl
index 40d1b1a945..808164c34d 100644
--- a/src/test/modules/commit_ts/t/004_restart.pl
+++ b/src/test/modules/commit_ts/t/004_restart.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 16;
+use Test::More;
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
$node_primary->init(allows_streaming => 1);
@@ -150,3 +150,5 @@ is($after_enable_disabled_ts, '',
'timestamp of disabled tx null after re-enable');
$node_primary->stop;
+
+done_testing();
diff --git a/src/test/modules/test_misc/t/001_constraint_validation.pl b/src/test/modules/test_misc/t/001_constraint_validation.pl
index 7bd6022035..3b9fc66b8e 100644
--- a/src/test/modules/test_misc/t/001_constraint_validation.pl
+++ b/src/test/modules/test_misc/t/001_constraint_validation.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 42;
+use Test::More;
# Initialize a test cluster
my $node = PostgreSQL::Test::Cluster->new('primary');
@@ -311,3 +311,5 @@ ok( $output =~
run_sql_command('DROP TABLE quuux;');
$node->stop('fast');
+
+done_testing();
diff --git a/src/test/modules/test_misc/t/002_tablespace.pl b/src/test/modules/test_misc/t/002_tablespace.pl
index 4e4c35b4f2..6fea419bb8 100644
--- a/src/test/modules/test_misc/t/002_tablespace.pl
+++ b/src/test/modules/test_misc/t/002_tablespace.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 20;
+use Test::More;
my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
@@ -97,3 +97,5 @@ $result = $node->psql('postgres', "DROP TABLESPACE regress_ts4");
ok($result == 0, 'drop tablespace 4');
$node->stop;
+
+done_testing();
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 72b2d316cc..6700399d8e 100644
--- a/src/test/modules/test_misc/t/003_check_guc.pl
+++ b/src/test/modules/test_misc/t/003_check_guc.pl
@@ -5,7 +5,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 3;
+use Test::More;
my $node = PostgreSQL::Test::Cluster->new('main');
$node->init;
@@ -106,3 +106,5 @@ foreach my $param (@sample_intersect)
"found GUC $param in postgresql.conf.sample, marked as NOT_IN_SAMPLE\n"
);
}
+
+done_testing();
diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
index a906f8f03d..c73bd37835 100644
--- a/src/test/modules/test_pg_dump/t/001_base.pl
+++ b/src/test/modules/test_pg_dump/t/001_base.pl
@@ -718,44 +718,6 @@ $node->start;
my $port = $node->port;
-my $num_tests = 0;
-
-foreach my $run (sort keys %pgdump_runs)
-{
- my $test_key = $run;
-
- # Each run of pg_dump is a test itself
- $num_tests++;
-
- # If there is a restore cmd, that's another test
- if ($pgdump_runs{$run}->{restore_cmd})
- {
- $num_tests++;
- }
-
- if ($pgdump_runs{$run}->{test_key})
- {
- $test_key = $pgdump_runs{$run}->{test_key};
- }
-
- # Then count all the tests run against each run
- foreach my $test (sort keys %tests)
- {
- # If there is a like entry, but no unlike entry, then we will test the like case
- if ($tests{$test}->{like}->{$test_key}
- && !defined($tests{$test}->{unlike}->{$test_key}))
- {
- $num_tests++;
- }
- else
- {
- # We will test everything that isn't a 'like'
- $num_tests++;
- }
- }
-}
-plan tests => $num_tests;
-
#########################################
# Set up schemas, tables, etc, to be dumped.
@@ -847,3 +809,5 @@ foreach my $run (sort keys %pgdump_runs)
# Stop the database instance, which will be removed at the end of the tests.
$node->stop('fast');
+
+done_testing();
diff --git a/src/test/perl/README b/src/test/perl/README
index 9e870830cf..0511c55e9a 100644
--- a/src/test/perl/README
+++ b/src/test/perl/README
@@ -54,8 +54,7 @@ Each test script should begin with:
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
- # Replace with the number of tests to execute:
- use Test::More tests => 1;
+ use Test::More;
then it will generally need to set up one or more nodes, run commands
against them and evaluate the results. For example:
@@ -69,6 +68,10 @@ against them and evaluate the results. For example:
$node->stop('fast');
+Each test script should end with:
+
+ done_testing();
+
Test::More::like entails use of the qr// operator. Avoid Perl 5.8.8 bug
#39185 by not using the "$" regular expression metacharacter in qr// when also
using the "/m" modifier. Instead of "$", use "\n" or "(?=\n|\z)".
diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl
index ca760c7210..583ee87da8 100644
--- a/src/test/recovery/t/001_stream_rep.pl
+++ b/src/test/recovery/t/001_stream_rep.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 55;
+use Test::More;
# Initialize primary node
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
@@ -529,3 +529,5 @@ ok( ($phys_restart_lsn_pre cmp $phys_restart_lsn_post) == 0,
my $primary_data = $node_primary->data_dir;
ok(!-f "$primary_data/pg_wal/$segment_removed",
"WAL segment $segment_removed recycled after physical slot advancing");
+
+done_testing();
diff --git a/src/test/recovery/t/002_archiving.pl b/src/test/recovery/t/002_archiving.pl
index 9a0451b8e4..c8f5ffbaf0 100644
--- a/src/test/recovery/t/002_archiving.pl
+++ b/src/test/recovery/t/002_archiving.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 7;
+use Test::More;
use File::Copy;
# Initialize primary node, doing archives
@@ -120,3 +120,5 @@ like(
$log_contents,
qr/WARNING:.*recovery_end_command/s,
"recovery_end_command failure detected in logs after promotion");
+
+done_testing();
diff --git a/src/test/recovery/t/003_recovery_targets.pl b/src/test/recovery/t/003_recovery_targets.pl
index 24da78c0bc..25dd5ee7ec 100644
--- a/src/test/recovery/t/003_recovery_targets.pl
+++ b/src/test/recovery/t/003_recovery_targets.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 9;
+use Test::More;
use Time::HiRes qw(usleep);
# Create and test a standby from given backup, with a certain recovery target.
@@ -182,3 +182,5 @@ $logfile = slurp_file($node_standby->logfile());
ok( $logfile =~
qr/FATAL: .* recovery ended before configured recovery target was reached/,
'recovery end before target reached is a fatal error');
+
+done_testing();
diff --git a/src/test/recovery/t/004_timeline_switch.pl b/src/test/recovery/t/004_timeline_switch.pl
index 05b7931668..3203d93701 100644
--- a/src/test/recovery/t/004_timeline_switch.pl
+++ b/src/test/recovery/t/004_timeline_switch.pl
@@ -7,7 +7,7 @@ use warnings;
use File::Path qw(rmtree);
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 3;
+use Test::More;
$ENV{PGDATABASE} = 'postgres';
@@ -106,3 +106,5 @@ $node_primary_2->wait_for_catchup($node_standby_3);
my $result_2 =
$node_standby_3->safe_psql('postgres', "SELECT count(*) FROM tab_int");
is($result_2, qq(1), 'check content of standby 3');
+
+done_testing();
diff --git a/src/test/recovery/t/005_replay_delay.pl b/src/test/recovery/t/005_replay_delay.pl
index 39c5675cc9..370fc9eace 100644
--- a/src/test/recovery/t/005_replay_delay.pl
+++ b/src/test/recovery/t/005_replay_delay.pl
@@ -7,7 +7,7 @@ use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 3;
+use Test::More;
# Initialize primary node
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
@@ -110,3 +110,5 @@ $node_standby2->poll_query_until('postgres',
$node_standby2->promote;
$node_standby2->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()")
or die "Timed out while waiting for promotion to finish";
+
+done_testing();
diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl
index 29b68a7f85..fa6bd45332 100644
--- a/src/test/recovery/t/006_logical_decoding.pl
+++ b/src/test/recovery/t/006_logical_decoding.pl
@@ -10,7 +10,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 15;
+use Test::More;
use Config;
# Initialize primary node
@@ -200,3 +200,5 @@ ok(($logical_restart_lsn_pre cmp $logical_restart_lsn_post) == 0,
# done with the node
$node_primary->stop;
+
+done_testing();
diff --git a/src/test/recovery/t/007_sync_rep.pl b/src/test/recovery/t/007_sync_rep.pl
index cebd590111..86f89c63e2 100644
--- a/src/test/recovery/t/007_sync_rep.pl
+++ b/src/test/recovery/t/007_sync_rep.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 11;
+use Test::More;
# Query checking sync_priority and sync_state of each standby
my $check_sql =
@@ -217,3 +217,5 @@ standby3|1|quorum
standby4|1|quorum),
'all standbys are considered as candidates for quorum sync standbys',
'ANY 2(*)');
+
+done_testing();
diff --git a/src/test/recovery/t/008_fsm_truncation.pl b/src/test/recovery/t/008_fsm_truncation.pl
index ee48c217cf..5be2153c33 100644
--- a/src/test/recovery/t/008_fsm_truncation.pl
+++ b/src/test/recovery/t/008_fsm_truncation.pl
@@ -10,7 +10,7 @@ use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 1;
+use Test::More;
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
$node_primary->init(allows_streaming => 1);
@@ -96,3 +96,5 @@ is( $node_standby->psql(
qq{insert into testtab select generate_series(1,1000), 'foo';}),
0,
'INSERT succeeds with truncated relation FSM');
+
+done_testing();
diff --git a/src/test/recovery/t/009_twophase.pl b/src/test/recovery/t/009_twophase.pl
index 2d0b3b0873..3e25b8c4eb 100644
--- a/src/test/recovery/t/009_twophase.pl
+++ b/src/test/recovery/t/009_twophase.pl
@@ -7,7 +7,7 @@ use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 24;
+use Test::More;
my $psql_out = '';
my $psql_rc = '';
@@ -480,3 +480,5 @@ $cur_standby->psql(
is( $psql_out,
qq{27|issued to paris},
"Check expected t_009_tbl2 data on standby");
+
+done_testing();
diff --git a/src/test/recovery/t/010_logical_decoding_timelines.pl b/src/test/recovery/t/010_logical_decoding_timelines.pl
index 672cd74f3b..6e8b0b1b96 100644
--- a/src/test/recovery/t/010_logical_decoding_timelines.pl
+++ b/src/test/recovery/t/010_logical_decoding_timelines.pl
@@ -26,7 +26,7 @@ use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 13;
+use Test::More;
use File::Copy;
use IPC::Run ();
use Scalar::Util qw(blessed);
@@ -196,3 +196,5 @@ is($stdout, $final_expected_output_bb,
'got same output from walsender via pg_recvlogical on before_basebackup');
$node_replica->teardown_node();
+
+done_testing();
diff --git a/src/test/recovery/t/011_crash_recovery.pl b/src/test/recovery/t/011_crash_recovery.pl
index 3892aba3e5..14154d1ce0 100644
--- a/src/test/recovery/t/011_crash_recovery.pl
+++ b/src/test/recovery/t/011_crash_recovery.pl
@@ -11,8 +11,6 @@ use PostgreSQL::Test::Utils;
use Test::More;
use Config;
-plan tests => 3;
-
my $node = PostgreSQL::Test::Cluster->new('primary');
$node->init(allows_streaming => 1);
$node->start;
@@ -62,3 +60,5 @@ is($node->safe_psql('postgres', qq[SELECT pg_xact_status('$xid');]),
$stdin .= "\\q\n";
$tx->finish; # wait for psql to quit gracefully
+
+done_testing();
diff --git a/src/test/recovery/t/012_subtransactions.pl b/src/test/recovery/t/012_subtransactions.pl
index 2a558b2301..f8075097a9 100644
--- a/src/test/recovery/t/012_subtransactions.pl
+++ b/src/test/recovery/t/012_subtransactions.pl
@@ -7,7 +7,7 @@ use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 12;
+use Test::More;
# Setup primary node
my $node_primary = PostgreSQL::Test::Cluster->new("primary");
@@ -214,3 +214,5 @@ $node_primary->psql(
"SELECT coalesce(sum(id),-1) FROM t_012_tbl",
stdout => \$psql_out);
is($psql_out, '-1', "Not visible");
+
+done_testing();
diff --git a/src/test/recovery/t/013_crash_restart.pl b/src/test/recovery/t/013_crash_restart.pl
index 44c6ac8a00..3b740eb6f3 100644
--- a/src/test/recovery/t/013_crash_restart.pl
+++ b/src/test/recovery/t/013_crash_restart.pl
@@ -18,9 +18,6 @@ use PostgreSQL::Test::Utils;
use Test::More;
use Config;
-plan tests => 18;
-
-
# To avoid hanging while expecting some specific input from a psql
# instance being driven by us, add a timeout high enough that it
# should never trigger even on very slow machines, unless something
@@ -272,3 +269,5 @@ sub pump_until
return 1;
}
+
+done_testing();
diff --git a/src/test/recovery/t/014_unlogged_reinit.pl b/src/test/recovery/t/014_unlogged_reinit.pl
index c1bb89176b..da77c1211f 100644
--- a/src/test/recovery/t/014_unlogged_reinit.pl
+++ b/src/test/recovery/t/014_unlogged_reinit.pl
@@ -10,7 +10,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 12;
+use Test::More;
my $node = PostgreSQL::Test::Cluster->new('main');
@@ -82,3 +82,5 @@ ok( !-f "$pgdata/${ts1UnloggedPath}_vm",
'vm fork in tablespace removed at startup');
ok( !-f "$pgdata/${ts1UnloggedPath}_fsm",
'fsm fork in tablespace removed at startup');
+
+done_testing();
diff --git a/src/test/recovery/t/015_promotion_pages.pl b/src/test/recovery/t/015_promotion_pages.pl
index 65443df5fe..8d57b1b3d6 100644
--- a/src/test/recovery/t/015_promotion_pages.pl
+++ b/src/test/recovery/t/015_promotion_pages.pl
@@ -9,7 +9,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 1;
+use Test::More;
# Initialize primary node
my $alpha = PostgreSQL::Test::Cluster->new('alpha');
@@ -85,3 +85,5 @@ $bravo->start;
my $psql_out;
$bravo->psql('postgres', "SELECT count(*) FROM test1", stdout => \$psql_out);
is($psql_out, '1000', "Check that table state is correct");
+
+done_testing();
diff --git a/src/test/recovery/t/016_min_consistency.pl b/src/test/recovery/t/016_min_consistency.pl
index 86fd6f5546..5e0655c2a9 100644
--- a/src/test/recovery/t/016_min_consistency.pl
+++ b/src/test/recovery/t/016_min_consistency.pl
@@ -11,7 +11,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 1;
+use Test::More;
# Find the largest LSN in the set of pages part of the given relation
# file. This is used for offline checks of page consistency. The LSN
@@ -139,3 +139,5 @@ die "No minRecoveryPoint in control file found\n"
# the pages on disk.
ok($offline_recovery_lsn ge $offline_max_lsn,
"Check offline that table data is consistent with minRecoveryPoint");
+
+done_testing();
diff --git a/src/test/recovery/t/017_shm.pl b/src/test/recovery/t/017_shm.pl
index d57679b531..678a252165 100644
--- a/src/test/recovery/t/017_shm.pl
+++ b/src/test/recovery/t/017_shm.pl
@@ -25,10 +25,6 @@ if ($@ || $windows_os)
{
plan skip_all => 'SysV shared memory not supported by this platform';
}
-else
-{
- plan tests => 4;
-}
my $tempdir = PostgreSQL::Test::Utils::tempdir;
@@ -218,3 +214,5 @@ sub poll_start
$node->start && return 1;
return 0;
}
+
+done_testing();
diff --git a/src/test/recovery/t/018_wal_optimize.pl b/src/test/recovery/t/018_wal_optimize.pl
index 2bc7b9aa3d..1410e2f03b 100644
--- a/src/test/recovery/t/018_wal_optimize.pl
+++ b/src/test/recovery/t/018_wal_optimize.pl
@@ -14,7 +14,7 @@ use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 38;
+use Test::More;
sub check_orphan_relfilenodes
{
@@ -399,3 +399,5 @@ wal_skip_threshold = 0
# Run same test suite for multiple wal_level values.
run_wal_optimize("minimal");
run_wal_optimize("replica");
+
+done_testing();
diff --git a/src/test/recovery/t/019_replslot_limit.pl b/src/test/recovery/t/019_replslot_limit.pl
index 76b6ba1987..4257bd4d35 100644
--- a/src/test/recovery/t/019_replslot_limit.pl
+++ b/src/test/recovery/t/019_replslot_limit.pl
@@ -11,7 +11,7 @@ use PostgreSQL::Test::Utils;
use PostgreSQL::Test::Cluster;
use File::Path qw(rmtree);
-use Test::More tests => $PostgreSQL::Test::Utils::windows_os ? 16 : 20;
+use Test::More;
use Time::HiRes qw(usleep);
$ENV{PGDATABASE} = 'postgres';
@@ -421,3 +421,5 @@ sub find_in_log
return $log =~ m/$pat/;
}
+
+done_testing();
diff --git a/src/test/recovery/t/020_archive_status.pl b/src/test/recovery/t/020_archive_status.pl
index 06c2b69ef4..cbff26e122 100644
--- a/src/test/recovery/t/020_archive_status.pl
+++ b/src/test/recovery/t/020_archive_status.pl
@@ -8,7 +8,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 16;
+use Test::More;
use Config;
my $primary = PostgreSQL::Test::Cluster->new('primary');
@@ -234,3 +234,5 @@ ok( -f "$standby2_data/$segment_path_1_done"
&& -f "$standby2_data/$segment_path_2_done",
".done files created after archive success with archive_mode=always on standby"
);
+
+done_testing();
diff --git a/src/test/recovery/t/021_row_visibility.pl b/src/test/recovery/t/021_row_visibility.pl
index 1ceb032750..e2743518de 100644
--- a/src/test/recovery/t/021_row_visibility.pl
+++ b/src/test/recovery/t/021_row_visibility.pl
@@ -8,7 +8,7 @@ use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 10;
+use Test::More;
use Config;
# Initialize primary node
@@ -208,3 +208,5 @@ sub send_query_and_wait
return 1;
}
+
+done_testing();
diff --git a/src/test/recovery/t/022_crash_temp_files.pl b/src/test/recovery/t/022_crash_temp_files.pl
index 2000f51731..6ab3092874 100644
--- a/src/test/recovery/t/022_crash_temp_files.pl
+++ b/src/test/recovery/t/022_crash_temp_files.pl
@@ -14,11 +14,6 @@ if ($Config{osname} eq 'MSWin32')
plan skip_all => 'tests hang on Windows';
exit;
}
-else
-{
- plan tests => 9;
-}
-
# To avoid hanging while expecting some specific input from a psql
# instance being driven by us, add a timeout high enough that it
@@ -275,3 +270,5 @@ sub pump_until
}
return 1;
}
+
+done_testing();
diff --git a/src/test/recovery/t/023_pitr_prepared_xact.pl b/src/test/recovery/t/023_pitr_prepared_xact.pl
index da13e1d0f3..39e8a8fa17 100644
--- a/src/test/recovery/t/023_pitr_prepared_xact.pl
+++ b/src/test/recovery/t/023_pitr_prepared_xact.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 1;
+use Test::More;
use File::Compare;
# Initialize and start primary node with WAL archiving
@@ -87,3 +87,5 @@ CHECKPOINT;
# still be found.
$node_pitr->stop('immediate');
$node_pitr->start;
+
+done_testing();
diff --git a/src/test/recovery/t/024_archive_recovery.pl b/src/test/recovery/t/024_archive_recovery.pl
index dccdbd5879..c10bb5bf70 100644
--- a/src/test/recovery/t/024_archive_recovery.pl
+++ b/src/test/recovery/t/024_archive_recovery.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 2;
+use Test::More;
use Time::HiRes qw(usleep);
# Initialize and start node with wal_level = replica and WAL archiving
@@ -101,3 +101,5 @@ test_recovery_wal_level_minimal('archive_recovery', 'archive recovery', 0);
# Test for standby server
test_recovery_wal_level_minimal('standby', 'standby', 1);
+
+done_testing();
diff --git a/src/test/recovery/t/025_stuck_on_old_timeline.pl b/src/test/recovery/t/025_stuck_on_old_timeline.pl
index dc48f909c4..d113c8cc9c 100644
--- a/src/test/recovery/t/025_stuck_on_old_timeline.pl
+++ b/src/test/recovery/t/025_stuck_on_old_timeline.pl
@@ -13,7 +13,7 @@ use PostgreSQL::Test::Utils;
use File::Basename;
use FindBin;
-use Test::More tests => 1;
+use Test::More;
# Initialize primary node
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
@@ -108,3 +108,5 @@ my $result =
$node_cascade->safe_psql('postgres', "SELECT count(*) FROM tab_int");
print "cascade: $result\n";
is($result, 1, 'check streamed content on cascade standby');
+
+done_testing();
diff --git a/src/test/recovery/t/026_overwrite_contrecord.pl b/src/test/recovery/t/026_overwrite_contrecord.pl
index e9aadad1b2..0fd907f152 100644
--- a/src/test/recovery/t/026_overwrite_contrecord.pl
+++ b/src/test/recovery/t/026_overwrite_contrecord.pl
@@ -10,8 +10,6 @@ use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
use Test::More;
-plan tests => 3;
-
# Test: Create a physical replica that's missing the last WAL file,
# then restart the primary to create a divergent WAL file and observe
# that the replica replays the "overwrite contrecord" from that new
@@ -104,3 +102,5 @@ like(
$node->stop;
$node_standby->stop;
+
+done_testing();
diff --git a/src/test/recovery/t/027_stream_regress.pl b/src/test/recovery/t/027_stream_regress.pl
index 37449006c1..c0aae707ea 100644
--- a/src/test/recovery/t/027_stream_regress.pl
+++ b/src/test/recovery/t/027_stream_regress.pl
@@ -12,10 +12,6 @@ if (PostgreSQL::Test::Utils::has_wal_read_bug)
# this test file to die(), not merely to fail.
plan skip_all => 'filesystem bug';
}
-else
-{
- plan tests => 4;
-}
# Initialize primary node
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
@@ -91,3 +87,5 @@ command_ok(
$node_standby_1->stop;
$node_primary->stop;
+
+done_testing();
diff --git a/src/test/ssl/t/001_ssltests.pl b/src/test/ssl/t/001_ssltests.pl
index 659ba9cb82..b8f8b65a8f 100644
--- a/src/test/ssl/t/001_ssltests.pl
+++ b/src/test/ssl/t/001_ssltests.pl
@@ -19,10 +19,6 @@ if ($ENV{with_ssl} ne 'openssl')
{
plan skip_all => 'OpenSSL not supported by this build';
}
-else
-{
- plan tests => 110;
-}
#### Some configuration
@@ -619,3 +615,5 @@ $node->connect_fails(
"$common_connstr user=ssltestuser sslcert=ssl/client-revoked.crt sslkey=$key{'client-revoked.key'}",
"certificate authorization fails with revoked client cert with server-side CRL directory",
expected_stderr => qr/SSL error: sslv3 alert certificate revoked/);
+
+done_testing();
diff --git a/src/test/ssl/t/002_scram.pl b/src/test/ssl/t/002_scram.pl
index d86e4b6341..41d231c55d 100644
--- a/src/test/ssl/t/002_scram.pl
+++ b/src/test/ssl/t/002_scram.pl
@@ -30,8 +30,6 @@ my $SERVERHOSTCIDR = '127.0.0.1/32';
my $supports_tls_server_end_point =
check_pg_config("#define HAVE_X509_GET_SIGNATURE_NID 1");
-my $number_of_tests = $supports_tls_server_end_point ? 11 : 12;
-
# Allocation of base connection string shared among multiple tests.
my $common_connstr;
@@ -118,4 +116,4 @@ $node->connect_ok(
qr/connection authenticated: identity="ssltestuser" method=scram-sha-256/
]);
-done_testing($number_of_tests);
+done_testing();
diff --git a/src/test/ssl/t/003_sslinfo.pl b/src/test/ssl/t/003_sslinfo.pl
index dec0fab161..f008ea6594 100644
--- a/src/test/ssl/t/003_sslinfo.pl
+++ b/src/test/ssl/t/003_sslinfo.pl
@@ -18,10 +18,6 @@ if ($ENV{with_ssl} ne 'openssl')
{
plan skip_all => 'OpenSSL not supported by this build';
}
-else
-{
- plan tests => 13;
-}
#### Some configuration
@@ -135,3 +131,5 @@ $result = $node->safe_psql("certdb",
"SELECT value, critical FROM ssl_extension_info() WHERE name = 'basicConstraints';",
connstr => $common_connstr);
is($result, 'CA:FALSE|t', 'extract extension from cert');
+
+done_testing();
diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl
index b7953c0931..af0cff6a30 100644
--- a/src/test/subscription/t/001_rep_changes.pl
+++ b/src/test/subscription/t/001_rep_changes.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 32;
+use Test::More;
# Initialize publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -537,3 +537,5 @@ ROLLBACK;
ok( $reterr =~
m/WARNING: wal_level is insufficient to publish logical changes/,
'CREATE PUBLICATION while wal_level=minimal');
+
+done_testing();
diff --git a/src/test/subscription/t/002_types.pl b/src/test/subscription/t/002_types.pl
index 3f0792ed84..3f1f00f7c8 100644
--- a/src/test/subscription/t/002_types.pl
+++ b/src/test/subscription/t/002_types.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 4;
+use Test::More;
# Initialize publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -566,3 +566,5 @@ is($result, '21', 'sql-function constraint on domain');
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/003_constraints.pl b/src/test/subscription/t/003_constraints.pl
index 6f3ebd6781..63c22699c0 100644
--- a/src/test/subscription/t/003_constraints.pl
+++ b/src/test/subscription/t/003_constraints.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 6;
+use Test::More;
# Initialize publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -137,3 +137,5 @@ is($result, qq(2|1|2),
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/004_sync.pl b/src/test/subscription/t/004_sync.pl
index 1e0e64c0d7..cf61fc1e0f 100644
--- a/src/test/subscription/t/004_sync.pl
+++ b/src/test/subscription/t/004_sync.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 8;
+use Test::More;
# Initialize publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -178,3 +178,5 @@ is($result, qq(0),
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/005_encoding.pl b/src/test/subscription/t/005_encoding.pl
index d7513b1c61..38a74a897f 100644
--- a/src/test/subscription/t/005_encoding.pl
+++ b/src/test/subscription/t/005_encoding.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 1;
+use Test::More;
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
$node_publisher->init(
@@ -53,3 +53,5 @@ is( $node_subscriber->safe_psql(
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/006_rewrite.pl b/src/test/subscription/t/006_rewrite.pl
index 7a86ae2d16..c924ff35f7 100644
--- a/src/test/subscription/t/006_rewrite.pl
+++ b/src/test/subscription/t/006_rewrite.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 2;
+use Test::More;
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
$node_publisher->init(allows_streaming => 'logical');
@@ -66,3 +66,5 @@ is( $node_subscriber->safe_psql('postgres', q{SELECT a, b, c FROM test1}),
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/007_ddl.pl b/src/test/subscription/t/007_ddl.pl
index d1e8db3150..1144b005f6 100644
--- a/src/test/subscription/t/007_ddl.pl
+++ b/src/test/subscription/t/007_ddl.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 1;
+use Test::More;
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
$node_publisher->init(allows_streaming => 'logical');
@@ -43,3 +43,5 @@ pass "subscription disable and drop in same transaction did not hang";
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/008_diff_schema.pl b/src/test/subscription/t/008_diff_schema.pl
index c1a88911f4..67b4026afa 100644
--- a/src/test/subscription/t/008_diff_schema.pl
+++ b/src/test/subscription/t/008_diff_schema.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 5;
+use Test::More;
# Create publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -126,3 +126,5 @@ is( $node_subscriber->safe_psql(
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/009_matviews.pl b/src/test/subscription/t/009_matviews.pl
index 8acbbce0a3..1ce696d4a4 100644
--- a/src/test/subscription/t/009_matviews.pl
+++ b/src/test/subscription/t/009_matviews.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 1;
+use Test::More;
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
$node_publisher->init(allows_streaming => 'logical');
@@ -50,3 +50,5 @@ pass "materialized view data not replicated";
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/010_truncate.pl b/src/test/subscription/t/010_truncate.pl
index 16f0031b03..d519249431 100644
--- a/src/test/subscription/t/010_truncate.pl
+++ b/src/test/subscription/t/010_truncate.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 14;
+use Test::More;
# setup
@@ -239,3 +239,5 @@ is($result, qq(0||), 'truncate replicated for multiple subscriptions');
$result = $node_subscriber->safe_psql('postgres',
"SELECT deadlocks FROM pg_stat_database WHERE datname='postgres'");
is($result, qq(0), 'no deadlocks detected');
+
+done_testing();
diff --git a/src/test/subscription/t/011_generated.pl b/src/test/subscription/t/011_generated.pl
index d2900f648d..e991a08032 100644
--- a/src/test/subscription/t/011_generated.pl
+++ b/src/test/subscription/t/011_generated.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 2;
+use Test::More;
# setup
@@ -64,3 +64,5 @@ is( $result, qq(1|22
3|66
4|88
6|132), 'generated columns replicated');
+
+done_testing();
diff --git a/src/test/subscription/t/012_collation.pl b/src/test/subscription/t/012_collation.pl
index 8eb245712e..2182f7948e 100644
--- a/src/test/subscription/t/012_collation.pl
+++ b/src/test/subscription/t/012_collation.pl
@@ -9,11 +9,7 @@ use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
use Test::More;
-if ($ENV{with_icu} eq 'yes')
-{
- plan tests => 2;
-}
-else
+if ($ENV{with_icu} ne 'yes')
{
plan skip_all => 'ICU not supported by this build';
}
@@ -108,3 +104,5 @@ $node_publisher->wait_for_catchup('sub1');
is($node_subscriber->safe_psql('postgres', q{SELECT b FROM tab2}),
qq(bar),
'update with replica identity full with nondeterministic collation');
+
+done_testing();
diff --git a/src/test/subscription/t/013_partition.pl b/src/test/subscription/t/013_partition.pl
index 85db48ff0a..5266471a7a 100644
--- a/src/test/subscription/t/013_partition.pl
+++ b/src/test/subscription/t/013_partition.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 63;
+use Test::More;
# setup
@@ -740,3 +740,5 @@ ok( $logfile =~
# $node_subscriber1->append_conf('postgresql.conf',
# "log_min_messages = warning");
# $node_subscriber1->reload;
+
+done_testing();
diff --git a/src/test/subscription/t/014_binary.pl b/src/test/subscription/t/014_binary.pl
index f3cfcbb00e..a1f03e7adc 100644
--- a/src/test/subscription/t/014_binary.pl
+++ b/src/test/subscription/t/014_binary.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 5;
+use Test::More;
# Create and initialize a publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -135,3 +135,5 @@ is( $result, '{1,2,3}|{42,1.2,1.3}|
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/015_stream.pl b/src/test/subscription/t/015_stream.pl
index 2385803c18..9f221fc78c 100644
--- a/src/test/subscription/t/015_stream.pl
+++ b/src/test/subscription/t/015_stream.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 4;
+use Test::More;
# Create publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -133,3 +133,5 @@ is($result, qq(6667|6667|6667),
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/016_stream_subxact.pl b/src/test/subscription/t/016_stream_subxact.pl
index c00b6bcc47..f27f1694f2 100644
--- a/src/test/subscription/t/016_stream_subxact.pl
+++ b/src/test/subscription/t/016_stream_subxact.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 2;
+use Test::More;
# Create publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -91,3 +91,5 @@ is($result, qq(1667|1667|1667),
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/017_stream_ddl.pl b/src/test/subscription/t/017_stream_ddl.pl
index fabe033cc2..0bce63b716 100644
--- a/src/test/subscription/t/017_stream_ddl.pl
+++ b/src/test/subscription/t/017_stream_ddl.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 3;
+use Test::More;
# Create publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -127,3 +127,5 @@ is($result, qq(5005|5002|4005|3004|5),
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/018_stream_subxact_abort.pl b/src/test/subscription/t/018_stream_subxact_abort.pl
index 6810895711..7155442e76 100644
--- a/src/test/subscription/t/018_stream_subxact_abort.pl
+++ b/src/test/subscription/t/018_stream_subxact_abort.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 4;
+use Test::More;
# Create publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -131,3 +131,5 @@ is($result, qq(2500|0), 'check rollback was reflected on subscriber');
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/019_stream_subxact_ddl_abort.pl b/src/test/subscription/t/019_stream_subxact_ddl_abort.pl
index 83e2b7ba61..dbd0fca4d1 100644
--- a/src/test/subscription/t/019_stream_subxact_ddl_abort.pl
+++ b/src/test/subscription/t/019_stream_subxact_ddl_abort.pl
@@ -7,7 +7,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 2;
+use Test::More;
# Create publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -85,3 +85,5 @@ is($result, qq(1000|500),
$node_subscriber->stop;
$node_publisher->stop;
+
+done_testing();
diff --git a/src/test/subscription/t/020_messages.pl b/src/test/subscription/t/020_messages.pl
index 9bb31ce9e8..b5045ff3c4 100644
--- a/src/test/subscription/t/020_messages.pl
+++ b/src/test/subscription/t/020_messages.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 5;
+use Test::More;
# Create publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -146,3 +146,5 @@ is( $result, qq(77|0
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/021_twophase.pl b/src/test/subscription/t/021_twophase.pl
index 88ef341825..aacc0fcf46 100644
--- a/src/test/subscription/t/021_twophase.pl
+++ b/src/test/subscription/t/021_twophase.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 24;
+use Test::More;
###############################
# Setup
@@ -359,3 +359,5 @@ is($result, qq(0), 'check replication origin was dropped on subscriber');
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/022_twophase_cascade.pl b/src/test/subscription/t/022_twophase_cascade.pl
index 80680f06a0..900c25d5ce 100644
--- a/src/test/subscription/t/022_twophase_cascade.pl
+++ b/src/test/subscription/t/022_twophase_cascade.pl
@@ -9,7 +9,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 41;
+use Test::More;
###############################
# Setup a cascade of pub/sub nodes.
@@ -394,3 +394,5 @@ is($result, qq(0), 'check replication slot was dropped on publisher node A');
$node_C->stop('fast');
$node_B->stop('fast');
$node_A->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/023_twophase_stream.pl b/src/test/subscription/t/023_twophase_stream.pl
index 250fdd550d..93ce3ef132 100644
--- a/src/test/subscription/t/023_twophase_stream.pl
+++ b/src/test/subscription/t/023_twophase_stream.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 18;
+use Test::More;
###############################
# Setup
@@ -282,3 +282,5 @@ is($result, qq(0), 'check replication origin was dropped on subscriber');
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/024_add_drop_pub.pl b/src/test/subscription/t/024_add_drop_pub.pl
index 015cabf906..561ddde421 100644
--- a/src/test/subscription/t/024_add_drop_pub.pl
+++ b/src/test/subscription/t/024_add_drop_pub.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 3;
+use Test::More;
# Initialize publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -96,3 +96,5 @@ is($result, qq(20|1|10), 'check initial data is copied to subscriber');
# shutdown
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/025_rep_changes_for_schema.pl b/src/test/subscription/t/025_rep_changes_for_schema.pl
index 197d68aafd..2a6ba5403d 100644
--- a/src/test/subscription/t/025_rep_changes_for_schema.pl
+++ b/src/test/subscription/t/025_rep_changes_for_schema.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 13;
+use Test::More;
# Initialize publisher node
my $node_publisher = PostgreSQL::Test::Cluster->new('publisher');
@@ -203,3 +203,5 @@ is($result, qq(21|1|21), 'check replicated inserts on subscriber');
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/026_worker_stats.pl b/src/test/subscription/t/026_worker_stats.pl
index 6cf21c8fee..f72e4766e8 100644
--- a/src/test/subscription/t/026_worker_stats.pl
+++ b/src/test/subscription/t/026_worker_stats.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 3;
+use Test::More;
# Test if the error reported on pg_stat_subscription_workers view is expected.
sub test_subscription_error
@@ -161,3 +161,5 @@ is($result, q(0), 'no error after dropping subscription');
$node_subscriber->stop('fast');
$node_publisher->stop('fast');
+
+done_testing();
diff --git a/src/test/subscription/t/027_nosuperuser.pl b/src/test/subscription/t/027_nosuperuser.pl
index 4902542b5e..4815e6ccff 100644
--- a/src/test/subscription/t/027_nosuperuser.pl
+++ b/src/test/subscription/t/027_nosuperuser.pl
@@ -5,7 +5,7 @@
use strict;
use warnings;
use PostgreSQL::Test::Cluster;
-use Test::More tests => 14;
+use Test::More;
my ($node_publisher, $node_subscriber, $publisher_connstr, $result, $offset);
$offset = 0;
@@ -278,3 +278,5 @@ publish_delete("alice.unpartitioned", 17);
expect_replication(
"alice.unpartitioned", 2, 23, 25,
"nosuperuser nobypassrls table owner can replicate delete into unpartitioned despite rls");
+
+done_testing();
diff --git a/src/test/subscription/t/100_bugs.pl b/src/test/subscription/t/100_bugs.pl
index dc361756cc..11ba473715 100644
--- a/src/test/subscription/t/100_bugs.pl
+++ b/src/test/subscription/t/100_bugs.pl
@@ -6,7 +6,7 @@ use strict;
use warnings;
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
-use Test::More tests => 7;
+use Test::More;
# Bug #15114
@@ -306,3 +306,5 @@ is( $node_subscriber->safe_psql(
$node_publisher->stop('fast');
$node_subscriber->stop('fast');
+
+done_testing();