brianc / node-pg-pool

A connection pool for node-postgres
MIT License
180 stars 64 forks source link

Fix _endCallback #106

Open fanatid opened 5 years ago

fanatid commented 5 years ago

If Pool#end happens between client initiate connection and receiving callback with error, _endCallback will be never called.

charmander commented 5 years ago

Is it possible to include a test?

fanatid commented 5 years ago

I tried do this, but found this is not trivial

fanatid commented 5 years ago

Any updates? Tests required for each PR?

charmander commented 5 years ago

You should be able to write the test by making a net.Server that does nothing with the client it accepts but call pool.end() and close the connection. There are a few similar tests that already exist (look for createServer).