Drain pool connection before

This commit is contained in:
Daniel García Aubert
2018-11-05 18:37:20 +01:00
parent 659b0ba889
commit 40ccdfd9b3
2 changed files with 6 additions and 1 deletions

View File

@@ -94,7 +94,7 @@ const DATASOURCE_TIMEOUT_ERROR = {
}]
};
describe('user database timeout limit', function () {
describe.only('user database timeout limit', function () {
describe('dataview', function () {
beforeEach(function (done) {
const mapconfig = createMapConfig();

View File

@@ -1275,6 +1275,11 @@ TestClient.prototype.setUserDatabaseTimeoutLimit = function (timeoutLimit, callb
});
step(
// we need to guarantee all new connections have the new settings
function beforeRefreshPoolConnection () {
const next = this;
psql.end(() => next());
},
function configureTimeouts () {
const timeoutSQLs = [
`ALTER ROLE "${publicuser}" SET STATEMENT_TIMEOUT TO ${timeoutLimit}`,