From 1b4de5a82cba00b418bce78918a0489ba0855ad6 Mon Sep 17 00:00:00 2001 From: ekneg54 Date: Tue, 12 Nov 2024 09:20:56 +0100 Subject: [PATCH] speed up kafka output tests --- tests/unit/connector/test_confluent_kafka_output.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/unit/connector/test_confluent_kafka_output.py b/tests/unit/connector/test_confluent_kafka_output.py index cb79c52c4..35cb590c4 100644 --- a/tests/unit/connector/test_confluent_kafka_output.py +++ b/tests/unit/connector/test_confluent_kafka_output.py @@ -29,7 +29,7 @@ class TestConfluentKafkaOutput(BaseOutputTestCase, CommonConfluentKafkaTestCase) "topic": "test_input_raw", "flush_timeout": 0.1, "kafka_config": { - "bootstrap.servers": "testserver:9092", + "bootstrap.servers": "localhost:9092", }, } @@ -109,7 +109,7 @@ def test_store_counts_processed_events(self, _): # pylint: disable=arguments-di assert self.object.metrics.number_of_processed_events == 1 def test_setup_raises_fatal_output_error_on_invalid_config(self): - kafka_config = {"myconfig": "the config", "bootstrap.servers": "testserver:9092"} + kafka_config = {"myconfig": "the config", "bootstrap.servers": "localhost:9092"} config = deepcopy(self.CONFIG) config.update({"kafka_config": kafka_config}) connector = Factory.create({"test connector": config}) @@ -164,3 +164,7 @@ def test_shutdown_logs_and_counts_error_if_queue_not_fully_flushed(self): self.object.shut_down() mock_error.assert_called() self.object.metrics.number_of_errors = 1 + + def test_health_returns_bool(self): + with mock.patch.object(self.object, "_admin"): + super().test_health_returns_bool()