Skip to content

Commit

Permalink
speed up kafka output tests (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 authored Nov 12, 2024
1 parent 382848f commit ed4e659
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/unit/connector/test_confluent_kafka_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}

Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -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()

0 comments on commit ed4e659

Please sign in to comment.