Use utils

This commit is contained in:
Adria Navarro 2024-11-06 17:16:49 +01:00
parent 4f6a09fb02
commit b2488af6da
6 changed files with 11 additions and 10 deletions

View File

@ -1,7 +1,12 @@
import tk from "timekeeper" import tk from "timekeeper"
import _ from "lodash" import _ from "lodash"
import { DBTestConfiguration, generator, structures } from "../../../tests" import {
DBTestConfiguration,
generator,
structures,
utils,
} from "../../../tests"
import { getDB } from "../../db" import { getDB } from "../../db"
import { import {
@ -13,11 +18,7 @@ import {
const initialTime = Date.now() const initialTime = Date.now()
async function waitForQueueCompletion() { async function waitForQueueCompletion() {
do { await utils.queue.processMessages(DocWritethroughProcessor.queue)
await DocWritethroughProcessor.queue.whenCurrentJobsFinished()
} while (await DocWritethroughProcessor.queue.count())
await DocWritethroughProcessor.queue.whenCurrentJobsFinished()
} }
describe("docWritethrough", () => { describe("docWritethrough", () => {

View File

@ -4,4 +4,3 @@ export { generator } from "./structures"
export * as testContainerUtils from "./testContainerUtils" export * as testContainerUtils from "./testContainerUtils"
export * as utils from "./utils" export * as utils from "./utils"
export * from "./jestUtils" export * from "./jestUtils"
export * as queue from "./queue"

View File

@ -1 +1,2 @@
export * as time from "./time" export * as time from "./time"
export * as queue from "./queue"

@ -1 +1 @@
Subproject commit 21e9cb41076c7064b6d5e16e0434705149440023 Subproject commit a35c797b1f2cc067b6edd78d498bb2e239d677e1

View File

@ -1,4 +1,4 @@
import { mocks, structures, queue } from "@budibase/backend-core/tests" import { mocks, structures, utils } from "@budibase/backend-core/tests"
import { context, events, features } from "@budibase/backend-core" import { context, events, features } from "@budibase/backend-core"
import { Event, IdentityType } from "@budibase/types" import { Event, IdentityType } from "@budibase/types"
import { TestConfiguration } from "../../../../tests" import { TestConfiguration } from "../../../../tests"
@ -55,7 +55,7 @@ describe("/api/global/auditlogs (%s)", () => {
await events.app.created(structures.apps.app(APP_ID)) await events.app.created(structures.apps.app(APP_ID))
}) })
await queue.processMessages( await utils.queue.processMessages(
events.processors.auditLogsProcessor.queue events.processors.auditLogsProcessor.queue
) )