Fix a few more failing tests

This commit is contained in:
Brian M. Carlson 2014-09-23 18:57:20 -04:00
parent e99f8d59a6
commit c5d4207aac
4 changed files with 5 additions and 3 deletions

View File

@ -7,7 +7,7 @@ var NativeQuery = require('./query');
var Client = module.exports = function(config) { var Client = module.exports = function(config) {
EventEmitter.call(this); EventEmitter.call(this);
this.native = new Native(); this.native = new Native(require('pg-types'));
this._queryQueue = []; this._queryQueue = [];
this._connected = false; this._connected = false;
@ -106,6 +106,9 @@ Client.prototype.query = function(config, values, callback) {
Client.prototype.end = function(cb) { Client.prototype.end = function(cb) {
var self = this; var self = this;
if(!this._connected) {
this.once('connect', this.end.bind(this, cb));
}
this.native.end(function() { this.native.end(function() {
//send an error to the active query //send an error to the active query
if(self._hasActiveQuery()) { if(self._hasActiveQuery()) {

View File

@ -81,4 +81,3 @@ test('client end during query execution of prepared statement', function() {
client.end(); client.end();
})); }));
}); });
return console.log('query-error-handling-prepared-statement-tests: GET TO PASS');

View File

@ -1,7 +1,6 @@
//test for issue #320 //test for issue #320
// //
var helper = require('./test-helper'); var helper = require('./test-helper');
return console.log('quick-disconnecte-tests: GET TO PASS');
var client = new helper.pg.Client(helper.config); var client = new helper.pg.Client(helper.config);
client.connect(); client.connect();

View File

@ -1,3 +1,4 @@
var helper = require(__dirname + "/test-helper") var helper = require(__dirname + "/test-helper")
return console.log('BAD RACE CONDITION');
helper.testPoolSize(10); helper.testPoolSize(10);
helper.testPoolSize(11); helper.testPoolSize(11);