diff --git a/plugin-server/tests/e2e.timeout.test.ts b/plugin-server/tests/e2e.timeout.test.ts index 0bde3412315f3..029ad7509cec2 100644 --- a/plugin-server/tests/e2e.timeout.test.ts +++ b/plugin-server/tests/e2e.timeout.test.ts @@ -54,7 +54,7 @@ describe('e2e ingestion timeout', () => { expect((await hub.db.fetchEvents()).length).toBe(0) const uuid = new UUIDT().toString() await posthog.capture('custom event', { name: 'haha', uuid, randomProperty: 'lololo' }) - await delayUntilEventIngested(() => hub.db.fetchEvents()) + await delayUntilEventIngested(() => hub.db.fetchEvents(), { maxDelayMs: 50000 }) await hub.kafkaProducer.flush() const events = await hub.db.fetchEvents() diff --git a/plugin-server/tests/helpers/clickhouse.ts b/plugin-server/tests/helpers/clickhouse.ts index 3f651e2c7bbaa..afb0df7c26584 100644 --- a/plugin-server/tests/helpers/clickhouse.ts +++ b/plugin-server/tests/helpers/clickhouse.ts @@ -34,10 +34,13 @@ export async function resetTestDatabaseClickhouse(extraServerConfig?: Partial( fetchData: () => T | Promise, - minLength = 1, - delayMs = 100, - maxDelayMs = 5000 + options: { + minLength?: number + delayMs?: number + maxDelayMs?: number + } = {} ): Promise { + const { minLength = 1, delayMs = 100, maxDelayMs = 5000 } = options const timer = performance.now() let data: T let dataLength = 0