> On 29 Jun 2020, at 21:27, Tom Lane <t...@sss.pgh.pa.us> wrote: > Hmm ... so I guess my reaction to both of these is "what guarantees > that we get to the part of the script that does the unlinks?". > I've certainly seen lots of TAP tests fail to complete. Could we > do the cleanup in an END block or the like? (I'm a poor enough > Perl programmer to be uncertain what's the best way, but I know > Perl has constructs like that.)
If execution calls die() during testing, then we wont reach the clean up portion at the end but we would if we did it as part of END which is (unless my memory is too fogged) guaranteed to be the last code to run before the interpreter exits. That being said, we do retain temporary files on such failures on purpose in our TestLib since 88802e068017bee8cea7a5502a712794e761c7b5 and a few follow-up commits since, should these be handled differently? They are admittedly less "unknown" as compared to other files as they are copies, but famous last words have been spoken about bugs that can never happen. cheers ./daniel