I see that c818c25f4 worked around sidewinder's issue with this test, but wrasse is still unhappy. I was able to duplicate the problem on wrasse's host, so I ran it under truss to see if I could see what's happening.
What the truss log shows is that the Perl script successfully reads psql.pid and issues kill(SIGINT) to the correct process ... but very shortly thereafter it issues kill(SIGTERM) to the same process, so of course psql goes belly-up and doesn't complete the test. I suppose this is some undocumented interaction between IPC::Run and the SIGALRM signal handler. I stand by the recommendation that you need to not use a signal handler here. regards, tom lane