Skip to content

Commit e3fa794

Browse files
authored
fix: Do not try to clone functions. (#117)
* fix: Do not try to clone functions. Signed-off-by: Paolo Insogna <[email protected]>
1 parent 2285c64 commit e3fa794

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
test-command: ci
2323
name: 'Node.js ${{ matrix.node-version }} / Confluent Kafka ${{ matrix.confluent-kafka-version }}'
2424
runs-on: ubuntu-latest
25-
timeout-minutes: 10
25+
timeout-minutes: 20
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v4

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
"lint": "eslint --cache",
3131
"typecheck": "tsc -p . --noEmit",
3232
"format": "prettier -w benchmarks playground src test",
33-
"test": "c8 -c test/config/c8-local.json node --env-file=test/config/env --no-warnings --test --test-timeout=300000 'test/**/*.test.ts'",
34-
"test:ci": "c8 -c test/config/c8-ci.json node --env-file=test/config/env --no-warnings --test --test-timeout=300000 'test/**/*.test.ts'",
33+
"test": "c8 -c test/config/c8-local.json node --env-file=test/config/env --no-warnings --test --test-timeout=600000 'test/**/*.test.ts'",
34+
"test:ci": "c8 -c test/config/c8-ci.json node --env-file=test/config/env --no-warnings --test --test-timeout=600000 'test/**/*.test.ts'",
3535
"test:docker:up": "node scripts/docker.ts up -d --wait",
3636
"test:docker:down": "node scripts/docker.ts down",
3737
"ci": "npm run build && npm run lint && npm run test:ci",
38-
"ci:v20": "npm run lint && rm -rf dist && tsc -p tsconfig.json && node dist/scripts/postbuild.js && cd dist && c8 -c ../test/config/c8-ci.json node --env-file=../test/config/env --no-warnings --test --test-timeout=300000",
38+
"ci:v20": "npm run lint && rm -rf dist && tsc -p tsconfig.json && node dist/scripts/postbuild.js && cd dist && c8 -c ../test/config/c8-ci.json node --env-file=../test/config/env --no-warnings --test --test-timeout=600000",
3939
"prepublishOnly": "npm run build && npm run lint",
4040
"postpublish": "git push origin && git push origin -f --tags",
4141
"generate:apis": "node scripts/generate-apis.ts",
@@ -81,4 +81,4 @@
8181
"engines": {
8282
"node": ">= 20.19.4 || >= 22.18.0 || >= 24.6.0"
8383
}
84-
}
84+
}

src/clients/consumer/messages-stream.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,18 @@ export class MessagesStream<Key, Value, HeaderKey, HeaderValue> extends Readable
7070
consumer: Consumer<Key, Value, HeaderKey, HeaderValue>,
7171
options: ConsumeOptions<Key, Value, HeaderKey, HeaderValue>
7272
) {
73-
const { autocommit, mode, fallbackMode, maxFetches, offsets, deserializers, onCorruptedMessage, ...otherOptions } =
74-
options
73+
const {
74+
autocommit,
75+
mode,
76+
fallbackMode,
77+
maxFetches,
78+
offsets,
79+
deserializers,
80+
onCorruptedMessage,
81+
// The options below are only destructured to avoid being part of structuredClone below
82+
partitionAssigner: _partitionAssigner,
83+
...otherOptions
84+
} = options
7585

7686
if (offsets && mode !== MessagesStreamModes.MANUAL) {
7787
throw new UserError('Cannot specify offsets when the stream mode is not MANUAL.')

test/clients/consumer/consumer.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ test('fetch should retrieve messages from multiple batches', async t => {
12611261
}
12621262
})
12631263

1264-
test('fetch should retrieve messages from multiple batches', async t => {
1264+
test.only('fetch should retrieve messages from multiple batches (compressed)', async t => {
12651265
const topic = await createTopic(t, true)
12661266
const producer = await createProducer(t)
12671267

@@ -1276,7 +1276,10 @@ test('fetch should retrieve messages from multiple batches', async t => {
12761276
autocommit: true,
12771277
topics: [topic],
12781278
mode: MessagesStreamModes.EARLIEST,
1279-
fallbackMode: MessagesStreamFallbackModes.EARLIEST
1279+
fallbackMode: MessagesStreamFallbackModes.EARLIEST,
1280+
minBytes: 1024 * 1024,
1281+
maxBytes: 1024 * 1024,
1282+
maxWaitTime: 100
12801283
})
12811284

12821285
let i = 0

0 commit comments

Comments
 (0)