Hi all

Trivial patch to change 'diag' to 'note' in TAP tests in
src/test/recovery attached.

It'll reduce the test output a little.

Those lines are there so you can tell what the test was doing before
it does something if it fails at a setup step, or to provide extra
diagnostic data, so they're retained, just muted to logs.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
From e944b3839d6ffec03040ccee1309c10057b12459 Mon Sep 17 00:00:00 2001
From: Craig Ringer <cr...@2ndquadrant.com>
Date: Wed, 22 Mar 2017 15:15:35 +0800
Subject: [PATCH] Change 'diag' to 'note' in recovery TAP tests

Reduce noise from TAP tests by changing 'diag' to 'note',
so output only goes to the test's log file not stdout.
---
 src/test/recovery/t/001_stream_rep.pl                 | 16 ++++++++--------
 src/test/recovery/t/006_logical_decoding.pl           |  2 +-
 src/test/recovery/t/010_logical_decoding_timelines.pl |  2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl
index 6c48839..ccd5943 100644
--- a/src/test/recovery/t/001_stream_rep.pl
+++ b/src/test/recovery/t/001_stream_rep.pl
@@ -60,7 +60,7 @@ is($node_standby_2->psql('postgres', 'INSERT INTO tab_int VALUES (1)'),
 	3, 'read-only queries on standby 2');
 
 # Tests for connection parameter target_session_attrs
-diag "testing connection parameter \"target_session_attrs\"";
+note "testing connection parameter \"target_session_attrs\"";
 
 # Routine designed to run tests on the connection parameter
 # target_session_attrs with multiple nodes.
@@ -107,7 +107,7 @@ test_target_session_attrs($node_master, $node_standby_1, $node_master,
 test_target_session_attrs($node_standby_1, $node_master, $node_standby_1,
 						  "any", 0);
 
-diag "switching to physical replication slot";
+note "switching to physical replication slot";
 # Switch to using a physical replication slot. We can do this without a new
 # backup since physical slots can go backwards if needed. Do so on both
 # standbys. Since we're going to be testing things that affect the slot state,
@@ -158,7 +158,7 @@ sub replay_check
 
 replay_check();
 
-diag "enabling hot_standby_feedback";
+note "enabling hot_standby_feedback";
 # Enable hs_feedback. The slot should gain an xmin. We set the status interval
 # so we'll see the results promptly.
 $node_standby_1->safe_psql('postgres', 'ALTER SYSTEM SET hot_standby_feedback = on;');
@@ -176,7 +176,7 @@ is($catalog_xmin, '', 'non-cascaded slot xmin still null with hs_feedback');
 isnt($xmin, '', 'cascaded slot xmin non-null with hs feedback');
 is($catalog_xmin, '', 'cascaded slot xmin still null with hs_feedback');
 
-diag "doing some work to advance xmin";
+note "doing some work to advance xmin";
 for my $i (10000..11000) {
 	$node_master->safe_psql('postgres', qq[INSERT INTO tab_int VALUES ($i);]);
 }
@@ -184,16 +184,16 @@ $node_master->safe_psql('postgres', 'VACUUM;');
 $node_master->safe_psql('postgres', 'CHECKPOINT;');
 
 my ($xmin2, $catalog_xmin2) = get_slot_xmins($node_master, $slotname_1);
-diag "new xmin $xmin2, old xmin $xmin";
+note "new xmin $xmin2, old xmin $xmin";
 isnt($xmin2, $xmin, 'non-cascaded slot xmin with hs feedback has changed');
 is($catalog_xmin2, '', 'non-cascaded slot xmin still null with hs_feedback unchanged');
 
 ($xmin2, $catalog_xmin2) = get_slot_xmins($node_standby_1, $slotname_2);
-diag "new xmin $xmin2, old xmin $xmin";
+note "new xmin $xmin2, old xmin $xmin";
 isnt($xmin2, $xmin, 'cascaded slot xmin with hs feedback has changed');
 is($catalog_xmin2, '', 'cascaded slot xmin still null with hs_feedback unchanged');
 
-diag "disabling hot_standby_feedback";
+note "disabling hot_standby_feedback";
 # Disable hs_feedback. Xmin should be cleared.
 $node_standby_1->safe_psql('postgres', 'ALTER SYSTEM SET hot_standby_feedback = off;');
 $node_standby_1->reload;
@@ -210,7 +210,7 @@ is($catalog_xmin, '', 'non-cascaded slot xmin still null with hs_feedback reset'
 is($xmin, '', 'cascaded slot xmin null with hs feedback reset');
 is($catalog_xmin, '', 'cascaded slot xmin still null with hs_feedback reset');
 
-diag "re-enabling hot_standby_feedback and disabling while stopped";
+note "re-enabling hot_standby_feedback and disabling while stopped";
 $node_standby_2->safe_psql('postgres', 'ALTER SYSTEM SET hot_standby_feedback = on;');
 $node_standby_2->reload;
 
diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl
index 66d5e4a..7476946 100644
--- a/src/test/recovery/t/006_logical_decoding.pl
+++ b/src/test/recovery/t/006_logical_decoding.pl
@@ -54,7 +54,7 @@ my $stdout_sql = $node_master->safe_psql('postgres', qq[SELECT data FROM pg_logi
 is($stdout_sql, $expected, 'got expected output from SQL decoding session');
 
 my $endpos = $node_master->safe_psql('postgres', "SELECT location FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY location DESC LIMIT 1;");
-diag "waiting to replay $endpos";
+note "waiting to replay $endpos";
 
 my $stdout_recv = $node_master->pg_recvlogical_upto('postgres', 'test_slot', $endpos, 10, 'include-xids' => '0', 'skip-empty-xacts' => '1');
 chomp($stdout_recv);
diff --git a/src/test/recovery/t/010_logical_decoding_timelines.pl b/src/test/recovery/t/010_logical_decoding_timelines.pl
index 09830dc..52ee771 100644
--- a/src/test/recovery/t/010_logical_decoding_timelines.pl
+++ b/src/test/recovery/t/010_logical_decoding_timelines.pl
@@ -38,7 +38,7 @@ $node_master->append_conf('postgresql.conf', "log_min_messages = 'debug2'\n");
 $node_master->dump_info;
 $node_master->start;
 
-diag "Testing logical timeline following with a filesystem-level copy";
+note "Testing logical timeline following with a filesystem-level copy";
 
 $node_master->safe_psql('postgres',
 "SELECT pg_create_logical_replication_slot('before_basebackup', 'test_decoding');"
-- 
2.5.5

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to