UBERF-6202: Use only one mongo pull per configuration (#5073)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-03-27 15:19:16 +05:00
committed by GitHub
parent 418b4b1bbd
commit 183239f2fe
5 changed files with 152 additions and 87 deletions
+4 -5
View File
@@ -44,9 +44,8 @@ import {
DummyFullTextAdapter,
type FullTextAdapter
} from '@hcengineering/server-core'
import { type MongoClient } from 'mongodb'
import { createMongoAdapter, createMongoTxAdapter } from '..'
import { getMongoClient, shutdown } from '../utils'
import { getMongoClient, type MongoClientReference, shutdown } from '../utils'
import { genMinModel } from './minmodel'
import { createTaskModel, type Task, type TaskComment, taskPlugin } from './tasks'
@@ -80,7 +79,7 @@ async function createNullContentTextAdapter (): Promise<ContentTextAdapter> {
describe('mongo operations', () => {
const mongodbUri: string = process.env.MONGO_URL ?? 'mongodb://localhost:27017'
let mongoClient!: MongoClient
let mongoClient!: MongoClientReference
let dbId: string = generateId()
let hierarchy: Hierarchy
let model: ModelDb
@@ -88,7 +87,7 @@ describe('mongo operations', () => {
let operations: TxOperations
beforeAll(async () => {
mongoClient = await getMongoClient(mongodbUri)
mongoClient = getMongoClient(mongodbUri)
})
afterAll(async () => {
@@ -101,7 +100,7 @@ describe('mongo operations', () => {
afterEach(async () => {
try {
await mongoClient.db(dbId).dropDatabase()
await (await mongoClient.getClient()).db(dbId).dropDatabase()
} catch (eee) {}
})