Skip to content

Commit

Permalink
fix tests for http input and confluent kafka outptu
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Oct 9, 2024
1 parent 4661308 commit 81ababa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 2 additions & 4 deletions logprep/connector/http/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,8 @@ def setup(self):
"""

super().setup()
if not hasattr(self, "pipeline_index"):
raise FatalInputError(
self, "Necessary instance attribute `pipeline_index` could not be found."
)
if self.pipeline_index is None:
raise FatalInputError(self, "Necessary instance attribute `pipeline_index` is not set.")
# Start HTTP Input only when in first process
if self.pipeline_index != 1:
return
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/connector/test_confluent_kafka_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint: disable=wrong-import-position
# pylint: disable=wrong-import-order
# pylint: disable=attribute-defined-outside-init
import os
import socket
from copy import deepcopy
from unittest import mock
Expand Down Expand Up @@ -254,7 +255,7 @@ def test_default_config_is_injected(self, mock_consumer):
"statistics.interval.ms": "30000",
"bootstrap.servers": "testserver:9092",
"group.id": "testgroup",
"group.instance.id": f"{socket.getfqdn().strip('.')}-PipelineNone",
"group.instance.id": f"{socket.getfqdn().strip('.')}-PipelineNone-pid{os.getpid()}",
"logger": logger,
"on_commit": self.object._commit_callback,
"stats_cb": self.object._stats_callback,
Expand Down

0 comments on commit 81ababa

Please sign in to comment.