fix: add timeout functionality to kafka (#7472)

Co-authored-by: joaofilipesilva <joao.silva@clearops.com>
This commit is contained in:
João Filipe Silvaandjoaofilipesilva authored and GitHub committed 2026-06-04 10:36:40 +00:00
1 parent d0a63d56cf
commit 8e27fd1925
5 files changed
+36 -3

No files matched your search

@@ -0,0 +1,15 @@
const { describe, test } = require("node:test");
const assert = require("node:assert");
const { kafkaProducerAsync } = require("../../../server/util-server");
describe("Kafka Producer", () => {
test("rejects when broker is not reachable", async () => {
await assert.rejects(
kafkaProducerAsync(["localhost:19092"], "test-topic", "test-message", {
interval: 5,
connectionTimeout: 1,
}),
/.*/ // any error
);
});
});