Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix http input bug #657

Merged
merged 4 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* fixes a bug not increasing but decreasing timeout throttle factor of ThrottlingQueue
* handle DecodeError and unexpected Exceptions on requests in `http_input` separately

* fixes unbound local error in http input connector

## 13.1.1
### Improvements

Expand Down
1 change: 1 addition & 0 deletions logprep/framework/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def process_pipeline(self) -> PipelineResult:
Component.run_pending_tasks()

event = self._get_event()
result = None
if not event:
return None, None
if self._pipeline:
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/framework/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,15 @@ def test_pipeline_result_provides_event_received(self, _):
assert result.event_received == {"some": "event"}, "received event is as expected"
assert result.event == {"some": "event", "field": "foo"}, "processed event is as expected"

def test_process_event_can_be_bypassed_with_no_pipeline(self, _):
self.pipeline._pipeline = []
self.pipeline._input.get_next.return_value = ({"some": "event"}, None)
with mock.patch("logprep.framework.pipeline.Pipeline.process_event") as mock_process_event:
mock_process_event.return_value = None
result = self.pipeline.process_pipeline()
mock_process_event.assert_not_called()
assert isinstance(result, type(None))


class TestPipelineWithActualInput:
def setup_method(self):
Expand Down
Loading