mirror of
https://github.com/postgres/postgres.git
synced 2025-07-25 16:38:16 +00:00
Check status of nodes after regression test run in 027_stream_regress
This commit improves the recovery TAP test 027_stream_regress so as
regression diffs are printed only if both the primary and the standby
are still alive after the main regression test suite finishes, relying
on d4c9195eff
to do the job.
Particularly, a crash of the primary could scribble the contents
reported with mostly useless data, as the diffs would refer to query
that failed to run, not necessarily the cause of the crash.
Suggested-by: Andres Freund <andres@anarazel.de>
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://postgr.es/m/CAN55FZ1D6KXvjSs7YGsDeadqCxNF3UUhjRAfforzzP0k-cE=bA@mail.gmail.com
This commit is contained in:
@ -81,7 +81,14 @@ my $rc =
|
|||||||
. "--max-concurrent-tests=20 "
|
. "--max-concurrent-tests=20 "
|
||||||
. "--inputdir=../regress "
|
. "--inputdir=../regress "
|
||||||
. "--outputdir=\"$outputdir\"");
|
. "--outputdir=\"$outputdir\"");
|
||||||
if ($rc != 0)
|
|
||||||
|
# Regression diffs are only meaningful if both the primary and the standby
|
||||||
|
# are still alive after a regression test failure. A crash would cause a
|
||||||
|
# useless increase in the log quantity, mostly filled with information
|
||||||
|
# related to queries that could not run.
|
||||||
|
my $primary_alive = $node_primary->is_alive;
|
||||||
|
my $standby_alive = $node_standby_1->is_alive;
|
||||||
|
if ($rc != 0 && $primary_alive && $standby_alive)
|
||||||
{
|
{
|
||||||
# Dump out the regression diffs file, if there is one
|
# Dump out the regression diffs file, if there is one
|
||||||
my $diffs = "$outputdir/regression.diffs";
|
my $diffs = "$outputdir/regression.diffs";
|
||||||
@ -93,6 +100,8 @@ if ($rc != 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is($rc, 0, 'regression tests pass');
|
is($rc, 0, 'regression tests pass');
|
||||||
|
is($primary_alive, 1, 'primary alive after regression test run');
|
||||||
|
is($standby_alive, 1, 'standby alive after regression test run');
|
||||||
|
|
||||||
# Clobber all sequences with their next value, so that we don't have
|
# Clobber all sequences with their next value, so that we don't have
|
||||||
# differences between nodes due to caching.
|
# differences between nodes due to caching.
|
||||||
|
Reference in New Issue
Block a user