Skip to content

Commit 2e74e63

Browse files
committed
Change 'diag' to 'note' in TAP tests
Reduce noise from TAP tests by changing 'diag' to 'note', so output only goes to the test's log file not stdout, unless in verbose mode. This also removes the junk on screen when running the TAP tests in parallel. Author: Craig Ringer <craig@2ndquadrant.com>
1 parent 767bc02 commit 2e74e63

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

src/test/recovery/t/001_stream_rep.pl

+8-8
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
3, 'read-only queries on standby 2');
6161

6262
# Tests for connection parameter target_session_attrs
63-
diag "testing connection parameter \"target_session_attrs\"";
63+
note "testing connection parameter \"target_session_attrs\"";
6464

6565
# Routine designed to run tests on the connection parameter
6666
# target_session_attrs with multiple nodes.
@@ -107,7 +107,7 @@ sub test_target_session_attrs
107107
test_target_session_attrs($node_standby_1, $node_master, $node_standby_1,
108108
"any", 0);
109109

110-
diag "switching to physical replication slot";
110+
note "switching to physical replication slot";
111111
# Switch to using a physical replication slot. We can do this without a new
112112
# backup since physical slots can go backwards if needed. Do so on both
113113
# standbys. Since we're going to be testing things that affect the slot state,
@@ -158,7 +158,7 @@ sub replay_check
158158

159159
replay_check();
160160

161-
diag "enabling hot_standby_feedback";
161+
note "enabling hot_standby_feedback";
162162
# Enable hs_feedback. The slot should gain an xmin. We set the status interval
163163
# so we'll see the results promptly.
164164
$node_standby_1->safe_psql('postgres', 'ALTER SYSTEM SET hot_standby_feedback = on;');
@@ -176,24 +176,24 @@ sub replay_check
176176
isnt($xmin, '', 'cascaded slot xmin non-null with hs feedback');
177177
is($catalog_xmin, '', 'cascaded slot xmin still null with hs_feedback');
178178

179-
diag "doing some work to advance xmin";
179+
note "doing some work to advance xmin";
180180
for my $i (10000..11000) {
181181
$node_master->safe_psql('postgres', qq[INSERT INTO tab_int VALUES ($i);]);
182182
}
183183
$node_master->safe_psql('postgres', 'VACUUM;');
184184
$node_master->safe_psql('postgres', 'CHECKPOINT;');
185185

186186
my ($xmin2, $catalog_xmin2) = get_slot_xmins($node_master, $slotname_1);
187-
diag "new xmin $xmin2, old xmin $xmin";
187+
note "new xmin $xmin2, old xmin $xmin";
188188
isnt($xmin2, $xmin, 'non-cascaded slot xmin with hs feedback has changed');
189189
is($catalog_xmin2, '', 'non-cascaded slot xmin still null with hs_feedback unchanged');
190190

191191
($xmin2, $catalog_xmin2) = get_slot_xmins($node_standby_1, $slotname_2);
192-
diag "new xmin $xmin2, old xmin $xmin";
192+
note "new xmin $xmin2, old xmin $xmin";
193193
isnt($xmin2, $xmin, 'cascaded slot xmin with hs feedback has changed');
194194
is($catalog_xmin2, '', 'cascaded slot xmin still null with hs_feedback unchanged');
195195

196-
diag "disabling hot_standby_feedback";
196+
note "disabling hot_standby_feedback";
197197
# Disable hs_feedback. Xmin should be cleared.
198198
$node_standby_1->safe_psql('postgres', 'ALTER SYSTEM SET hot_standby_feedback = off;');
199199
$node_standby_1->reload;
@@ -210,7 +210,7 @@ sub replay_check
210210
is($xmin, '', 'cascaded slot xmin null with hs feedback reset');
211211
is($catalog_xmin, '', 'cascaded slot xmin still null with hs_feedback reset');
212212

213-
diag "re-enabling hot_standby_feedback and disabling while stopped";
213+
note "re-enabling hot_standby_feedback and disabling while stopped";
214214
$node_standby_2->safe_psql('postgres', 'ALTER SYSTEM SET hot_standby_feedback = on;');
215215
$node_standby_2->reload;
216216

src/test/recovery/t/010_logical_decoding_timelines.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
$node_master->dump_info;
4646
$node_master->start;
4747

48-
diag "Testing logical timeline following with a filesystem-level copy";
48+
note "testing logical timeline following with a filesystem-level copy";
4949

5050
$node_master->safe_psql('postgres',
5151
"SELECT pg_create_logical_replication_slot('before_basebackup', 'test_decoding');"

src/test/ssl/ServerSetup.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ sub switch_server_cert
9898
my $cafile = $_[2] || "root+client_ca";
9999
my $pgdata = $node->data_dir;
100100

101-
diag "Reloading server with certfile \"$certfile\" and cafile \"$cafile\"...";
101+
note "reloading server with certfile \"$certfile\" and cafile \"$cafile\"";
102102

103103
open my $sslconf, '>', "$pgdata/sslconfig.conf";
104104
print $sslconf "ssl=on\n";

src/test/ssl/t/001_ssltests.pl

+14-14
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ sub test_connect_fails
7373

7474
#### Part 0. Set up the server.
7575

76-
diag "setting up data directory...";
76+
note "setting up data directory";
7777
my $node = get_new_node('master');
7878
$node->init;
7979

@@ -91,36 +91,36 @@ sub test_connect_fails
9191
### on sslmode and whether the server's certificate looks correct. No
9292
### client certificate is used in these tests.
9393

94-
diag "running client tests...";
94+
note "running client tests";
9595

9696
$common_connstr =
9797
"user=ssltestuser dbname=trustdb sslcert=invalid hostaddr=$SERVERHOSTADDR host=common-name.pg-ssltest.test";
9898

9999
# The server should not accept non-SSL connections
100-
diag "test that the server doesn't accept non-SSL connections";
100+
note "test that the server doesn't accept non-SSL connections";
101101
test_connect_fails("sslmode=disable");
102102

103103
# Try without a root cert. In sslmode=require, this should work. In verify-ca
104104
# or verify-full mode it should fail
105-
diag "connect without server root cert";
105+
note "connect without server root cert";
106106
test_connect_ok("sslrootcert=invalid sslmode=require");
107107
test_connect_fails("sslrootcert=invalid sslmode=verify-ca");
108108
test_connect_fails("sslrootcert=invalid sslmode=verify-full");
109109

110110
# Try with wrong root cert, should fail. (we're using the client CA as the
111111
# root, but the server's key is signed by the server CA)
112-
diag "connect without wrong server root cert";
112+
note "connect without wrong server root cert";
113113
test_connect_fails("sslrootcert=ssl/client_ca.crt sslmode=require");
114114
test_connect_fails("sslrootcert=ssl/client_ca.crt sslmode=verify-ca");
115115
test_connect_fails("sslrootcert=ssl/client_ca.crt sslmode=verify-full");
116116

117117
# Try with just the server CA's cert. This fails because the root file
118118
# must contain the whole chain up to the root CA.
119-
diag "connect with server CA cert, without root CA";
119+
note "connect with server CA cert, without root CA";
120120
test_connect_fails("sslrootcert=ssl/server_ca.crt sslmode=verify-ca");
121121

122122
# And finally, with the correct root cert.
123-
diag "connect with correct server CA cert file";
123+
note "connect with correct server CA cert file";
124124
test_connect_ok("sslrootcert=ssl/root+server_ca.crt sslmode=require");
125125
test_connect_ok("sslrootcert=ssl/root+server_ca.crt sslmode=verify-ca");
126126
test_connect_ok("sslrootcert=ssl/root+server_ca.crt sslmode=verify-full");
@@ -130,7 +130,7 @@ sub test_connect_fails
130130
test_connect_ok("sslrootcert=ssl/both-cas-1.crt sslmode=verify-ca");
131131
test_connect_ok("sslrootcert=ssl/both-cas-2.crt sslmode=verify-ca");
132132

133-
diag "testing sslcrl option with a non-revoked cert";
133+
note "testing sslcrl option with a non-revoked cert";
134134

135135
# Invalid CRL filename is the same as no CRL, succeeds
136136
test_connect_ok(
@@ -147,7 +147,7 @@ sub test_connect_fails
147147

148148
# Check that connecting with verify-full fails, when the hostname doesn't
149149
# match the hostname in the server's certificate.
150-
diag "test mismatch between hostname and server certificate";
150+
note "test mismatch between hostname and server certificate";
151151
$common_connstr =
152152
"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
153153

@@ -158,7 +158,7 @@ sub test_connect_fails
158158
# Test Subject Alternative Names.
159159
switch_server_cert($node, 'server-multiple-alt-names');
160160

161-
diag "test hostname matching with X509 Subject Alternative Names";
161+
note "test hostname matching with X.509 Subject Alternative Names";
162162
$common_connstr =
163163
"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
164164

@@ -173,7 +173,7 @@ sub test_connect_fails
173173
# slightly different error message, that's all)
174174
switch_server_cert($node, 'server-single-alt-name');
175175

176-
diag "test hostname matching with a single X509 Subject Alternative Name";
176+
note "test hostname matching with a single X.509 Subject Alternative Name";
177177
$common_connstr =
178178
"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
179179

@@ -186,7 +186,7 @@ sub test_connect_fails
186186
# should be ignored when the certificate has both.
187187
switch_server_cert($node, 'server-cn-and-alt-names');
188188

189-
diag "test certificate with both a CN and SANs";
189+
note "test certificate with both a CN and SANs";
190190
$common_connstr =
191191
"user=ssltestuser dbname=trustdb sslcert=invalid sslrootcert=ssl/root+server_ca.crt hostaddr=$SERVERHOSTADDR sslmode=verify-full";
192192

@@ -204,7 +204,7 @@ sub test_connect_fails
204204
test_connect_fails("sslmode=verify-full host=common-name.pg-ssltest.test");
205205

206206
# Test that the CRL works
207-
diag "Testing client-side CRL";
207+
note "testing client-side CRL";
208208
switch_server_cert($node, 'server-revoked');
209209

210210
$common_connstr =
@@ -220,7 +220,7 @@ sub test_connect_fails
220220
###
221221
### Test certificate authorization.
222222

223-
diag "Testing certificate authorization...";
223+
note "testing certificate authorization";
224224
$common_connstr =
225225
"sslrootcert=ssl/root+server_ca.crt sslmode=require dbname=certdb hostaddr=$SERVERHOSTADDR";
226226

0 commit comments

Comments
 (0)