Better handle interrupting TAP tests
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 19 Oct 2022 15:09:51 +0000 (17:09 +0200)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 19 Oct 2022 15:09:51 +0000 (17:09 +0200)
commit460c0076e8de6233eee53f4d6c175b04d8d41de9
treeed8a632c90e96176ddf374622158a3e547c761d4
parent342bb38bfeb099c5f8aa8f44a7e18f2dc21f1ecd
Better handle interrupting TAP tests

Set up a signal handler for INT/TERM so that we run our END block if we
get them.  In END, if the exit status indicates a problem, call
_update_pid(-1) to improve chances of the stop working in case start()
hasn't returned yet.

Also, change END's teardown_node() so that it passes fail_ok=>1, so that
if a node fails to stop, we still stop the other nodes in the same test.

Per complaint from Andres Freund.

This doesn't seem important enough to backpatch, at least for now.

Discussion: https://postgr.es/m/20220930040734.mbted42oiynhn2t6@awork3.anarazel.de
src/test/perl/PostgreSQL/Test/Cluster.pm