diff --git a/packages/kafka/tests/unit/consumer.test.ts b/packages/kafka/tests/unit/consumer.test.ts index 086a1a090d..8448d846a9 100644 --- a/packages/kafka/tests/unit/consumer.test.ts +++ b/packages/kafka/tests/unit/consumer.test.ts @@ -1,3 +1,4 @@ +import { setTimeout } from 'node:timers/promises'; import type { Context } from 'aws-lambda'; import { describe, expect, it } from 'vitest'; import { z } from 'zod/v4'; @@ -145,6 +146,7 @@ describe('Kafka consumer', () => { for (const record of event.records) { try { results.push(record.value); + await setTimeout(1); // simulate some processing time } catch (error) { return error; } @@ -247,6 +249,7 @@ describe('Kafka consumer', () => { for (const record of event.records) { try { const { value, key } = record; + await setTimeout(1); // simulate some processing time results.push([value, key]); } catch (error) { return error; @@ -444,6 +447,7 @@ describe('Kafka consumer', () => { try { const { value } = record; results.push(value); + await setTimeout(1); // simulate some processing time } catch (error) { results.push(error); } @@ -480,6 +484,7 @@ describe('Kafka consumer', () => { try { const { value } = record; results.push(value); + await setTimeout(1); // simulate some processing time } catch (error) { results.push(error); } @@ -531,6 +536,7 @@ describe('Kafka consumer', () => { try { const { value } = record; results.push(value); + await setTimeout(1); // simulate some processing time } catch (error) { results.push(error); } diff --git a/packages/kafka/tests/unit/deserializer.avro.test.ts b/packages/kafka/tests/unit/deserializer.avro.test.ts index 9893b5c258..7edccd5960 100644 --- a/packages/kafka/tests/unit/deserializer.avro.test.ts +++ b/packages/kafka/tests/unit/deserializer.avro.test.ts @@ -21,7 +21,7 @@ describe('Avro Deserializer: ', () => { expect(await deserialize(message, schema)).toEqual(expected); }); - it('throws when avro deserialiser fails', async () => { + it('throws when avro deserialiser fails', () => { // Prepare const message = '0g8MTGFwdG9wUrgehes/j0A='; const schema = `{ @@ -39,7 +39,7 @@ describe('Avro Deserializer: ', () => { ); }); - it('throws when avro deserialiser has not matching schema', async () => { + it('throws when avro deserialiser has not matching schema', () => { // Prepare const message = '0g8MTGFwdG9wUrgehes/j0A='; const schema = `{