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

[🐛 Bug]: unstable test test_incidents.py::test_incident_status_change #2234

Open
VladimirFilonov opened this issue Oct 18, 2024 · 0 comments
Assignees

Comments

@VladimirFilonov
Copy link
Contributor

Describe the bug
Sometimes test test_incidents.py::test_incident_status_change fails with exceptions like this:

elasticsearch.NotFoundError: NotFoundError(404, "{'_index': 'keep-alerts-test', '_id': 'fingerprint_99', 'found': False}")

Traceback (most recent call last):
  File "/home/runner/work/keep/keep/keep/api/routes/alerts.py", line 500, in _enrich_alert
    enrichement_bl.enrich_alert(
  File "/home/runner/work/keep/keep/keep/api/bl/enrichments_bl.py", line 445, in enrich_alert
    self.elastic_client.enrich_alert(
  File "/home/runner/work/keep/keep/keep/api/core/elastic.py", line 255, in enrich_alert
    alert = self._client.get(index=self.alerts_index, id=alert_fingerprint)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/keep/keep/.venv/lib/python3.11/site-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped
    return api(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/keep/keep/.venv/lib/python3.11/site-packages/elasticsearch/_sync/client/__init__.py", line 2022, in get
    return self.perform_request(  # type: ignore[return-value]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/keep/keep/.venv/lib/python3.11/site-packages/elasticsearch/_sync/client/_base.py", line 271, in perform_request
    response = self._perform_request(
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/keep/keep/.venv/lib/python3.11/site-packages/elasticsearch/_sync/client/_base.py", line 352, in _perform_request
    raise HTTP_EXCEPTIONS.get(meta.status, ApiError)(
elasticsearch.NotFoundError: NotFoundError(404, "{'_index': 'keep-alerts-test', '_id': 'fingerprint_99', 'found': False}")

Example of failed job

@VladimirFilonov VladimirFilonov self-assigned this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant