From b6ae60e40e22a48d71be122a5e401417f67f6139 Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Fri, 3 Apr 2026 16:56:30 +0200 Subject: [PATCH 1/2] chore: Fixed flaky test. Signed-off-by: Paolo Insogna --- test/clients/consumer/messages-stream.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/clients/consumer/messages-stream.test.ts b/test/clients/consumer/messages-stream.test.ts index 0ed2d42..d7b9e85 100644 --- a/test/clients/consumer/messages-stream.test.ts +++ b/test/clients/consumer/messages-stream.test.ts @@ -765,7 +765,7 @@ test('should support consume-transform-produce patterns', async t => { stream2.on('data', message => resolve(message.key)) // This will return immediately if there are messages - deepStrictEqual(await executeWithTimeout(promise, 1000, 'timeout'), 'timeout') + deepStrictEqual(await executeWithTimeout(promise, 3000, 'timeout'), 'timeout') }) test('should support maxFetches option', async t => { From b226ac09a2d68ce6ab04f11b20894ac0e4f75f43 Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Fri, 3 Apr 2026 17:10:00 +0200 Subject: [PATCH 2/2] fixup Signed-off-by: Paolo Insogna --- test/clients/consumer/messages-stream.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/clients/consumer/messages-stream.test.ts b/test/clients/consumer/messages-stream.test.ts index d7b9e85..3b049d4 100644 --- a/test/clients/consumer/messages-stream.test.ts +++ b/test/clients/consumer/messages-stream.test.ts @@ -48,7 +48,8 @@ import { mockedErrorMessage, mockedOperationId, mockMetadata, - mockMethod + mockMethod, + waitFor } from '../../helpers.ts' const defaultRetryDelay = 500 @@ -750,6 +751,10 @@ test('should support consume-transform-produce patterns', async t => { } await transaction.commit() + await waitFor(async () => { + const committedOffsets = await consumer.listCommittedOffsets({ topics: [{ topic, partitions: [0] }] }) + deepStrictEqual(committedOffsets.get(topic), [10n]) + }) await consumer.close(true) // Now consume again to verify all messages were committed