From 26f517fdff6bdcf698ed0079b84c89130e81458c Mon Sep 17 00:00:00 2001 From: Warro Date: Mon, 22 Jul 2019 15:39:50 +0300 Subject: [PATCH] Closed some open handles that were left after backend jest tests --- services/backend/oodikone2-backend/test/jest/globals.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/backend/oodikone2-backend/test/jest/globals.js b/services/backend/oodikone2-backend/test/jest/globals.js index 8048e88337..cdaaa624e4 100644 --- a/services/backend/oodikone2-backend/test/jest/globals.js +++ b/services/backend/oodikone2-backend/test/jest/globals.js @@ -1,4 +1,5 @@ const { sequelize } = require('../../src/models/index') +const { sequelizeKone } = require('../../src/models/models_kone') const { redisClient } = require('../../src/services/redis') const { forceSyncDatabase } = require('../../src/database/connection') const { seedAllMigrations } = require('../../src/database/seed_migrations') @@ -10,5 +11,7 @@ beforeAll(async () => { afterAll(async () => { await sequelize.close() - await redisClient.quitAsync() + await sequelizeKone.close() + // https://stackoverflow.com/a/54560610 + await new Promise(res => redisClient.quit(() => setImmediate(res))) }) \ No newline at end of file