Re: Inconsistent output handling in 002_pg_upgrade.pl test logs
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Joel Jacobson <joel@compiler.org>
Cc: "daniel@yesql.se" <daniel@yesql.se>, pgsql-hackers@lists.postgresql.org
Date: 2024-12-10T07:30:19Z
Lists: pgsql-hackers
On Mon, Oct 28, 2024 at 04:44:48PM +0100, Joel Jacobson wrote:
> On Mon, Oct 28, 2024, at 13:44, Daniel Gustafsson wrote:
>>> On 28 Oct 2024, at 13:38, Joel Jacobson <joel@compiler.org> wrote:
>>> Option 1: Keep output together using note
>>
>>> Option 2: Adjust header message for separate logs
>>
>>> Thoughts on these options?
>>
>> I would prefer to output this to the log only and not the TAP output, to avoid
>> the risk of not seeing the test output for all the log output on the screen.
My apologies for the late reply, this comes from 73db8f4d17ed so
this confision is on me.
The contents of the logs could be very long depending on the dump
used for the upgrade test, so agreed to print() the contents of the
logs as in option 2, without using note() everywhere.
> I also think that's best, and in line with what we do in other parts
> of the same script.
+ my $test_logfile = $PostgreSQL::Test::Utils::test_logfile;
+
+ note "=== pg_upgrade logs found - appending to $test_logfile ===\n";
foreach my $log (@log_files)
{
- note "=== contents of $log ===\n";
+ note "=== appending $log ===\n";
+ print "=== contents of $log ===\n";
print slurp_file($log);
print "=== EOF ===\n";
}
That's a clear improvement, thanks for the report. I'll see about a
backpatch, as well.
--
Michael
Commits
-
Improve reporting of pg_upgrade log files on test failure
- 8a8f26dda225 15.11 landed
- 058b208a5d12 16.7 landed
- 8afff7d6db25 17.3 landed
- 8ede5016859e 18.0 landed