mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-10-13 17:02:17 -05:00
fix: add timeout functionality to kafka (#7472)
Co-authored-by: joaofilipesilva <joao.silva@clearops.com>
This commit is contained in:
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
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user