diff options
author | Noah Misch <noah@leadboat.com> | 2020-02-05 08:26:41 -0800 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2020-02-05 08:26:44 -0800 |
commit | 78a26c3edd85b439265c067c45f04ce017c2eaff (patch) | |
tree | fcb0bb9d0ab421f3a38dc99dd1fc043a43930710 /src/test/perl/PostgresNode.pm | |
parent | 1fb8976b9cdd28f2986d63118fe64c00f600c531 (diff) | |
download | postgresql-78a26c3edd85b439265c067c45f04ce017c2eaff.tar.gz postgresql-78a26c3edd85b439265c067c45f04ce017c2eaff.zip |
When a TAP file has non-zero exit status, retain temporary directories.
PostgresNode already retained base directories in such cases. Stop
using $SIG{__DIE__}, which is redundant with the exit status check, in
lieu of proliferating it to TestLib. Back-patch to 9.6, where commit
88802e068017bee8cea7a5502a712794e761c7b5 introduced retention on
failure.
Reviewed by Daniel Gustafsson.
Discussion: https://postgr.es/m/20200202170155.GA3264196@rfd.leadboat.com
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r-- | src/test/perl/PostgresNode.pm | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 270bd6c8566..af13c320e9c 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -1206,20 +1206,6 @@ sub can_bind return $ret; } -# Retain the errno on die() if set, else assume a generic errno of 1. -# This will instruct the END handler on how to handle artifacts left -# behind from tests. -$SIG{__DIE__} = sub { - if ($!) - { - $died = $!; - } - else - { - $died = 1; - } -}; - # Automatically shut down any still-running nodes when the test script exits. # Note that this just stops the postmasters (in the same order the nodes were # created in). Any temporary directories are deleted, in an unspecified @@ -1238,8 +1224,7 @@ END next if defined $ENV{'PG_TEST_NOCLEAN'}; # clean basedir on clean test invocation - $node->clean_node - if TestLib::all_tests_passing() && !defined $died && !$exit_code; + $node->clean_node if $exit_code == 0 && TestLib::all_tests_passing(); } $? = $exit_code; |