I'm not done reviewing this yet, but a few questions first:
* I guess if the test dies, pgbouncer will now die as well so you don't need a pidfile to set things right during a later run?
* Why treat the files you open as binary? Take a pidfile, for instance. I don't suppose it'll ever matter, but isn't that a text file? Adding the "b" to the open modes seems to confuse more than help.
I'm not done reviewing this yet, but a few questions first:
* I guess if the test dies, pgbouncer will now die as well so you don't need a pidfile to set things right during a later run?
* Why treat the files you open as binary? Take a pidfile, for instance. I don't suppose it'll ever matter, but isn't that a text file? Adding the "b" to the open modes seems to confuse more than help.