This is in response to failed integration tests in pg module after recent changes in this module (#87).
Those tests failed due to client.end() was triggered two times. It is somehow related to the fact that drain event was triggered two times in here. Basically changing addition of that listener from client.on('drain', ...) to client.once('drain', ...), also solves the problem but I have a feeling that it would hide real issue.
After fix in this PR tests are passing but I'm not convinced if it's a complete solution for those failed tests either. I would say it's just a part of solution to cover unusual case.
This is in response to failed integration tests in
pg
module after recent changes in this module (#87).Those tests failed due to
client.end()
was triggered two times. It is somehow related to the fact thatdrain
event was triggered two times in here. Basically changing addition of that listener fromclient.on('drain', ...)
toclient.once('drain', ...)
, also solves the problem but I have a feeling that it would hide real issue.After fix in this PR tests are passing but I'm not convinced if it's a complete solution for those failed tests either. I would say it's just a part of solution to cover unusual case.