From 3675bf4f58a48f9f6522457208c54867e994ab5f Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 28 Sep 2023 09:05:18 +0200 Subject: [PATCH] fix: Flakey test (#17649) --- .../session-recordings-consumer-v2.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts b/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts index a2562eedcaa27..e39da232a1755 100644 --- a/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts +++ b/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts @@ -496,9 +496,6 @@ describe('ingester', () => { it("flushes and commits as it's revoked", async () => { await ingester.handleEachBatch([createMessage('sid1'), createMessage('sid2'), createMessage('sid3', 2)]) - const revokePromise = ingester.onRevokePartitions([createTP(1)]) - - expect(Object.keys(ingester.sessions)).toEqual([`${team.id}-sid3`]) expect(readdirSync(config.SESSION_RECORDING_LOCAL_DIRECTORY + '/session-buffer-files')).toEqual([ expect.stringContaining(`${team.id}.sid1.`), // gz @@ -509,6 +506,10 @@ describe('ingester', () => { expect.stringContaining(`${team.id}.sid3.`), // json ]) + const revokePromise = ingester.onRevokePartitions([createTP(1)]) + + expect(Object.keys(ingester.sessions)).toEqual([`${team.id}-sid3`]) + await revokePromise // Only files left on the system should be the sid3 ones