Hi,

Speaking as someone who regularly trawls through megabytes of build farm output:

1.  It seems a bit useless to have a load of "FATAL:  the database
system is in recovery mode" spam whenever the server crashes under
src/test/regress.  Any reason not to just turn that off, as we do for
the TAP tests?

2.  The TAP test logs are strangely named.  Any reason not to call
them 001_testname.log, instead of regress_log_001_testname, so they
appear next to the corresponding
001_testname_{primary,standby,xxx}.log in directory listings (CI) and
dumps (build farm, presumably), and have a traditional .log suffix?
From 2ddc124126ad0bb635023b805dbb6ad1b30fc863 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.mu...@gmail.com>
Date: Mon, 16 May 2022 10:34:04 +1200
Subject: [PATCH 1/2] Use restart_after_crash=off for regression tests.

Continuing to try to connect while the server is not accepting
connections in crash recovery produces a lot of useless extra log
material.  Let's not do that.
---
 src/test/regress/pg_regress.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 982801e029..9a04007651 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -2376,6 +2376,7 @@ regression_main(int argc, char *argv[],
 		snprintf(buf, sizeof(buf),
 				 "\"%s%spostgres\" -D \"%s/data\" -F%s "
 				 "-c \"listen_addresses=%s\" -k \"%s\" "
+				 "-c \"restart_after_crash=off\" "
 				 "> \"%s/log/postmaster.log\" 2>&1",
 				 bindir ? bindir : "",
 				 bindir ? "/" : "",
-- 
2.36.0

From aa24fa3b8b25bfc237ca007f9986fc2b8c9c37d7 Mon Sep 17 00:00:00 2001
From: Thomas Munro <thomas.mu...@gmail.com>
Date: Mon, 16 May 2022 10:36:30 +1200
Subject: [PATCH 2/2] Rename TAP test log output files.

Instead of "regress_log_001_testname", use "001_testname.log".  This
will cluster them with the corresponding server logs in sorted directory
listings (CI) and dumps (build farm).
---
 .cirrus.yml                            | 1 -
 src/test/perl/PostgreSQL/Test/Utils.pm | 2 +-
 src/test/perl/README                   | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index f23d6cae55..e7232b7a7c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -33,7 +33,6 @@ on_failure: &on_failure
     paths:
       - "**/*.log"
       - "**/*.diffs"
-      - "**/regress_log_*"
     type: text/plain
 
 task:
diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm
index 1ca2cc5917..8d7e20b0eb 100644
--- a/src/test/perl/PostgreSQL/Test/Utils.pm
+++ b/src/test/perl/PostgreSQL/Test/Utils.pm
@@ -201,7 +201,7 @@ INIT
 	# Open the test log file, whose name depends on the test name.
 	$test_logfile = basename($0);
 	$test_logfile =~ s/\.[^.]+$//;
-	$test_logfile = "$log_path/regress_log_$test_logfile";
+	$test_logfile = "$log_path/$test_logfile.log";
 	open my $testlog, '>', $test_logfile
 	  or die "could not open STDOUT to logfile \"$test_logfile\": $!";
 
diff --git a/src/test/perl/README b/src/test/perl/README
index 4b160cce36..1227944132 100644
--- a/src/test/perl/README
+++ b/src/test/perl/README
@@ -19,7 +19,7 @@ make check-world PROVE_FLAGS='--verbose'
 
 When a test fails, the terminal output from 'prove' is usually not sufficient
 to diagnose the problem.  Look into the log files that are left under
-tmp_check/log/ to get more info.  Files named 'regress_log_XXX' are log
+tmp_check/log/ to get more info.  Files named '001_testname.log' are log
 output from the perl test scripts themselves, and should be examined first.
 Other files are postmaster logs, and may be helpful as additional data.
 
-- 
2.36.0

Reply via email to