2011-08-12 10:52:29 +08:00
|
|
|
var helper = require(__dirname + '/test-helper');
|
2016-06-21 22:53:09 +08:00
|
|
|
var _ = require('lodash')
|
2011-08-12 10:52:29 +08:00
|
|
|
|
2016-06-21 22:53:09 +08:00
|
|
|
const config = _.extend({ }, helper.config, { idleTimeoutMillis: 50 })
|
2011-08-12 10:52:29 +08:00
|
|
|
|
|
|
|
test('idle timeout', function() {
|
2016-06-21 22:53:09 +08:00
|
|
|
helper.pg.connect(config, assert.calls(function(err, client, done) {
|
2011-08-12 10:52:29 +08:00
|
|
|
assert.isNull(err);
|
|
|
|
client.query('SELECT NOW()');
|
2016-06-21 22:53:09 +08:00
|
|
|
//just let this one time out
|
2011-08-12 10:52:29 +08:00
|
|
|
//test will hang if pool doesn't timeout
|
2013-03-08 05:57:00 +08:00
|
|
|
done();
|
2011-08-12 10:52:29 +08:00
|
|
|
}));
|
|
|
|
});
|