Skip to content

Commit

Permalink
remove print and disable http_input mock again
Browse files Browse the repository at this point in the history
- test if the http_input mock has a side effect on the domain_resolver test
  • Loading branch information
dtrai2 committed Dec 6, 2024
1 parent 20e2945 commit e37c274
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion logprep/processor/domain_resolver/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ def _add_resolve_infos_to_event(self, event, rule, resolved_ip):

def _resolve_ip(self, domain, hash_string=None):
try:
print(socket.gethostbyname)
result = self._thread_pool.apply_async(socket.gethostbyname, (domain,))
resolved_ip = result.get(timeout=self._config.timeout)
return resolved_ip
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/connector/test_http_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def create_credentials(tmp_path):
class TestHttpConnector(BaseInputTestCase):

def setup_method(self):
ThreadingHTTPServer.start = mock.MagicMock()
# ThreadingHTTPServer.start = mock.MagicMock()
HttpInput.messages = ThrottlingQueue(
ctx=multiprocessing.get_context(), maxsize=self.CONFIG.get("message_backlog_size")
)
Expand Down Expand Up @@ -94,7 +94,7 @@ def teardown_method(self):
while not self.object.messages.empty():
self.object.messages.get(timeout=0.001)
self.object.shut_down()
ThreadingHTTPServer.start = original_thread_start
# ThreadingHTTPServer.start = original_thread_start

def test_create_connector(self):
assert isinstance(self.object, HttpInput)
Expand Down

0 comments on commit e37c274

Please sign in to comment.