Ensure all pg connections are being refreshed

This commit is contained in:
Daniel García Aubert 2018-11-06 12:17:39 +01:00
parent 4d1ed0be27
commit f3b1bb742a
3 changed files with 1265 additions and 384 deletions

1642
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -576,7 +576,7 @@ describe('user database timeout limit', function () {
}); });
}); });
describe.skip('torque', function () { describe('torque', function () {
describe('while validating in layergroup creation', function () { describe('while validating in layergroup creation', function () {
beforeEach(function (done) { beforeEach(function (done) {
const mapconfig = createMapConfig({ const mapconfig = createMapConfig({

View File

@ -1267,6 +1267,11 @@ TestClient.prototype.setUserDatabaseTimeoutLimit = function (timeoutLimit, callb
const dbuser = _.template(global.environment.postgres_auth_user, { user_id: 1 }); const dbuser = _.template(global.environment.postgres_auth_user, { user_id: 1 });
const publicuser = global.environment.postgres.user; const publicuser = global.environment.postgres.user;
// IMPORTANT: node-postgres uses internallly a singleton, to refresh all pull connections
// you need to ensure that your dependency tree has only one working version of `cartodb-psql` & `node-postgres`
// if not, test using this function cannot ensure that all connections have the new settings (STATEMENT_TIMEOUT)
//
// TODO: upgrade to node-postgres@7.x
const psql = new PSQL({ const psql = new PSQL({
user: 'postgres', user: 'postgres',
dbname: dbname, dbname: dbname,