diff --git a/test/e2e/helpers/database-init.js b/test/e2e/helpers/database-init.js index c40f3e2305..fcebd564c0 100644 --- a/test/e2e/helpers/database-init.js +++ b/test/e2e/helpers/database-init.js @@ -54,8 +54,8 @@ module.exports = async function init(databaseSchema = 'test', getLogger) { const options = { databaseUrl: require('./database-config').getDatabaseUrl(), databaseSchema, - minPool: 1, - maxPool: 2, + minPool: 0, + maxPool: 1, getLogger, }; diff --git a/test/e2e/helpers/test-helper.js b/test/e2e/helpers/test-helper.js index 36c9e742f7..76ac6f109a 100644 --- a/test/e2e/helpers/test-helper.js +++ b/test/e2e/helpers/test-helper.js @@ -32,7 +32,13 @@ module.exports = { return { request: supertest.agent(app), - destroy: () => stores.db.destroy(), + destroy: async () => { + try { + await stores.db.destroy(); + } catch (error) { + console.error('Failed to destroy db', error); + } + }, }; }, async setupAppWithAuth(name) { @@ -41,7 +47,13 @@ module.exports = { return { request: supertest.agent(app), - destroy: () => stores.db.destroy(), + destroy: async () => { + try { + await stores.db.destroy(); + } catch (error) { + console.error('Failed to destroy db', error); + } + }, }; }, @@ -51,7 +63,13 @@ module.exports = { return { request: supertest.agent(app), - destroy: () => stores.db.destroy(), + destroy: async () => { + try { + await stores.db.destroy(); + } catch (error) { + console.error('Failed to destroy db', error); + } + }, }; }, };