Skip to content

Commit c5d4207

Browse files
committed
Fix a few more failing tests
1 parent e99f8d5 commit c5d4207

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

lib/native/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var NativeQuery = require('./query');
77

88
var Client = module.exports = function(config) {
99
EventEmitter.call(this);
10-
this.native = new Native();
10+
this.native = new Native(require('pg-types'));
1111
this._queryQueue = [];
1212
this._connected = false;
1313

@@ -106,6 +106,9 @@ Client.prototype.query = function(config, values, callback) {
106106

107107
Client.prototype.end = function(cb) {
108108
var self = this;
109+
if(!this._connected) {
110+
this.once('connect', this.end.bind(this, cb));
111+
}
109112
this.native.end(function() {
110113
//send an error to the active query
111114
if(self._hasActiveQuery()) {

test/integration/client/query-error-handling-prepared-statement-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,3 @@ test('client end during query execution of prepared statement', function() {
8181
client.end();
8282
}));
8383
});
84-
return console.log('query-error-handling-prepared-statement-tests: GET TO PASS');

test/integration/client/quick-disconnect-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//test for issue #320
22
//
33
var helper = require('./test-helper');
4-
return console.log('quick-disconnecte-tests: GET TO PASS');
54

65
var client = new helper.pg.Client(helper.config);
76
client.connect();
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
var helper = require(__dirname + "/test-helper")
2+
return console.log('BAD RACE CONDITION');
23
helper.testPoolSize(10);
34
helper.testPoolSize(11);

0 commit comments

Comments
 (0)