Subject: | Cleanup not working because of DESTROY order |
I don't think this is the same bug as https://rt.cpan.org/Ticket/Display.html?id=108460 - apologies if I've got that wrong.
base_dir is a File::Temp::Dir, however if Test::PostgreSQL is killed due to an error, DESTROY gets called, which calls ->stop(), which relies on base_dir still being around to create a sensible pg_ctrl statement.
pg_ctl: directory "/data" does not exist
(in cleanup) /usr/local/bin/pg_ctl stop -s -D /data -m fast failed:256
In my case I have a singleton, so I've just put an explicit stop in an END{} block, which works.