add failing test for #130
This commit is contained in:
parent
dd84db367b
commit
66ea0249d8
@ -1,10 +1,3 @@
|
|||||||
var helper = require(__dirname+'/../test-helper');
|
var helper = require(__dirname+'/../test-helper');
|
||||||
|
|
||||||
//creates a client from cli parameters
|
|
||||||
helper.client = function() {
|
|
||||||
var client = new Client(helper.config);
|
|
||||||
client.connect();
|
|
||||||
return client;
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = helper;
|
module.exports = helper;
|
||||||
|
17
test/integration/gh-issues/130.js
Normal file
17
test/integration/gh-issues/130.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
var helper = require(__dirname + '/../test-helper');
|
||||||
|
var exec = require('child_process').exec;
|
||||||
|
|
||||||
|
helper.pg.defaults.poolIdleTimeout = 1000;
|
||||||
|
|
||||||
|
helper.pg.connect(helper.config, function(err,client) {
|
||||||
|
client.query("SELECT pg_backend_pid()", function(err, result) {
|
||||||
|
var pid = result.rows[0].pg_backend_pid;
|
||||||
|
exec('psql -c "select pg_terminate_backend('+pid+')" template1', assert.calls(function (error, stdout, stderr) {
|
||||||
|
assert.isNull(error);
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
helper.pg.on('error', function(err, client) {
|
||||||
|
//swallow errors
|
||||||
|
});
|
@ -1,10 +1,18 @@
|
|||||||
var helper = require(__dirname + '/../test-helper');
|
var helper = require(__dirname + '/../test-helper');
|
||||||
|
|
||||||
//TODO would this be better served set at ../test-helper?
|
|
||||||
if(helper.args.native) {
|
if(helper.args.native) {
|
||||||
Client = require(__dirname + '/../../lib/native');
|
Client = require(__dirname + '/../../lib/native');
|
||||||
|
helper.Client = Client;
|
||||||
helper.pg = helper.pg.native;
|
helper.pg = helper.pg.native;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//creates a client from cli parameters
|
||||||
|
helper.client = function() {
|
||||||
|
var client = new Client(helper.config);
|
||||||
|
client.connect();
|
||||||
|
return client;
|
||||||
|
};
|
||||||
|
|
||||||
//export parent helper stuffs
|
//export parent helper stuffs
|
||||||
module.exports = helper;
|
module.exports = helper;
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ MemoryStream = function() {
|
|||||||
this.packets = [];
|
this.packets = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
helper.sys.inherits(MemoryStream, EventEmitter);
|
helper.sys.inherits(MemoryStream, EventEmitter);
|
||||||
|
|
||||||
var p = MemoryStream.prototype;
|
var p = MemoryStream.prototype;
|
||||||
@ -14,6 +15,8 @@ p.write = function(packet) {
|
|||||||
this.packets.push(packet);
|
this.packets.push(packet);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
p.writable = true;
|
||||||
|
|
||||||
createClient = function() {
|
createClient = function() {
|
||||||
var stream = new MemoryStream();
|
var stream = new MemoryStream();
|
||||||
stream.readyState = "open";
|
stream.readyState = "open";
|
||||||
|
Loading…
Reference in New Issue
Block a user