pg-pool
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -229,2 +229,6 @@ 'use strict' | ||
} | ||
// this client won’t be released, so move on immediately | ||
this._pulseQueue() | ||
cb(err, undefined, NOOP) | ||
@@ -231,0 +235,0 @@ } else { |
{ | ||
"name": "pg-pool", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Connection pool for node-postgres", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
'use strict' | ||
const net = require('net') | ||
const co = require('co') | ||
@@ -146,2 +147,23 @@ const expect = require('expect.js') | ||
}) | ||
it('should continue with queued items after a connection failure', (done) => { | ||
const closeServer = net.createServer((socket) => { | ||
socket.destroy() | ||
}).unref() | ||
closeServer.listen(() => { | ||
const pool = new Pool({ max: 1, port: closeServer.address().port }) | ||
pool.connect((err) => { | ||
expect(err).to.be.an(Error) | ||
expect(err.message).to.be('Connection terminated unexpectedly') | ||
}) | ||
pool.connect((err) => { | ||
expect(err).to.be.an(Error) | ||
expect(err.message).to.be('Connection terminated unexpectedly') | ||
closeServer.close(() => { | ||
pool.end(done) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
49037
1091
2