diff --git a/plugin-server/tests/cdp/cdp-consumer.e2e.test.ts b/plugin-server/tests/cdp/cdp-consumer.e2e.test.ts index 98cb2e041b042..8d6581aef9ef0 100644 --- a/plugin-server/tests/cdp/cdp-consumer.e2e.test.ts +++ b/plugin-server/tests/cdp/cdp-consumer.e2e.test.ts @@ -1,7 +1,7 @@ import { CdpFunctionCallbackConsumer, CdpProcessedEventsConsumer } from '../../src/cdp/cdp-consumers' import { HogFunctionInvocationGlobals, HogFunctionType } from '../../src/cdp/types' import { Hub, Team } from '../../src/types' -import { createHub } from '../../src/utils/db/hub' +import { closeHub, createHub } from '../../src/utils/db/hub' import { getFirstTeam, resetTestDatabase } from '../helpers/sql' import { HOG_EXAMPLES, HOG_FILTERS_EXAMPLES, HOG_INPUTS_EXAMPLES } from './examples' import { createHogExecutionGlobals, insertHogFunction as _insertHogFunction } from './fixtures' @@ -87,7 +87,6 @@ describe('CDP Consumers E2E', () => { let processedEventsConsumer: CdpProcessedEventsConsumer let functionProcessor: CdpFunctionCallbackConsumer let hub: Hub - let closeHub: () => Promise let team: Team const insertHogFunction = async (hogFunction: Partial) => { @@ -100,7 +99,7 @@ describe('CDP Consumers E2E', () => { beforeEach(async () => { await resetTestDatabase() - ;[hub, closeHub] = await createHub() + hub = await createHub() team = await getFirstTeam(hub) processedEventsConsumer = new CdpProcessedEventsConsumer(hub) @@ -115,7 +114,7 @@ describe('CDP Consumers E2E', () => { jest.setTimeout(10000) await processedEventsConsumer.stop() await functionProcessor.stop() - await closeHub() + await closeHub(hub) }) afterAll(() => {