From f49e34e85b2ff8079be9d100d0c2aeb9992c2f71 Mon Sep 17 00:00:00 2001 From: Ben White Date: Fri, 22 Sep 2023 09:26:03 +0200 Subject: [PATCH] Added check for pulled sessions --- .../session-recording/session-recordings-consumer-v2.test.ts | 5 +++++ 1 file changed, 5 insertions(+) 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 c106c6365b2e7..e983f90d3eb23 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 @@ -409,6 +409,11 @@ describe('ingester', () => { otherIngester.onAssignPartitions([createTP(2), createTP(3)]), ] + // Should immediately be removed from the tracked sessions + expect( + Object.values(ingester.sessions).map((x) => `${x.partition}:${x.sessionId}:${x.buffer.count}`) + ).toEqual(['1:session_id_1:1', '1:session_id_2:1']) + // Call the second ingester to receive the messages. The revocation should still be in progress meaning they are "paused" for a bit // Once the revocation is complete the second ingester should receive the messages but drop most of them as they got flushes by the revoke await otherIngester.handleEachBatch([