Skip to content

Commit 1e9b514

Browse files
committed
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 d4c9195 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
1 parent d4c9195 commit 1e9b514

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/test/recovery/t/027_stream_regress.pl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,14 @@
8181
. "--max-concurrent-tests=20 "
8282
. "--inputdir=../regress "
8383
. "--outputdir=\"$outputdir\"");
84-
if ($rc != 0)
84+
85+
# Regression diffs are only meaningful if both the primary and the standby
86+
# are still alive after a regression test failure. A crash would cause a
87+
# useless increase in the log quantity, mostly filled with information
88+
# related to queries that could not run.
89+
my $primary_alive = $node_primary->is_alive;
90+
my $standby_alive = $node_standby_1->is_alive;
91+
if ($rc != 0 && $primary_alive && $standby_alive)
8592
{
8693
# Dump out the regression diffs file, if there is one
8794
my $diffs = "$outputdir/regression.diffs";
@@ -93,6 +100,8 @@
93100
}
94101
}
95102
is($rc, 0, 'regression tests pass');
103+
is($primary_alive, 1, 'primary alive after regression test run');
104+
is($standby_alive, 1, 'standby alive after regression test run');
96105

97106
# Clobber all sequences with their next value, so that we don't have
98107
# differences between nodes due to caching.

0 commit comments

Comments
 (0)