From ac7509b01a0029c3728871502fe90ec17bb8fdfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 31 Jul 2017 18:24:42 +0200 Subject: [PATCH] Expose function to clean up database connections --- test/support/test-client.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/support/test-client.js b/test/support/test-client.js index 04a701b4..e35824d7 100644 --- a/test/support/test-client.js +++ b/test/support/test-client.js @@ -967,6 +967,9 @@ TestClient.setUserDatabaseTimeoutLimit = function (user, timeoutLimit, callback) const pass = _.template(global.environment.postgres_auth_pass, { user_id: 1 }) const publicuser = global.environment.postgres.user; + // we need to guarantee all new connections have the new settings + helper.cleanPGPoolConnections() + const psql = new PSQL({ user: 'postgres', dbname: dbname, @@ -989,3 +992,8 @@ TestClient.setUserDatabaseTimeoutLimit = function (user, timeoutLimit, callback) callback ); }; + +TestClient.cleanDatabaseConnections = function () { + helper.cleanPGPoolConnections() +} +