Skip to content

Commit

Permalink
fix(tester.py): Submit correct amount of total events to Argus
Browse files Browse the repository at this point in the history
This fix corrects an issue where amount of total events submitted to
Argus was amount of events requested from the events device (which would
be a 100). This is now corrected and total amount of events is now
correctly retrieved from event summary log.

Task: scylladb/qa-tasks#929
  • Loading branch information
k0machi authored and fruch committed May 29, 2023
1 parent 3bef3d2 commit fa67e84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdcm/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,10 @@ def argus_finalize_test_run(self):
last_events = get_events_grouped_by_category(
limit=last_events_limit, _registry=self.events_processes_registry)
events_sorted = []
events_summary = get_logger_event_summary()
for severity, messages in last_events.items():
event_category = EventsInfo(severity=severity, total_events=len(messages), messages=messages)
event_category = EventsInfo(
severity=severity, total_events=events_summary.get(severity, 0), messages=messages)
events_sorted.append(event_category)
self.test_config.argus_client().submit_events(events_sorted)
except Exception: # pylint: disable=broad-except
Expand Down
3 changes: 3 additions & 0 deletions unit_tests/test_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def _init_logging(self):
def update_certificates():
pass

def argus_finalize_test_run(self):
pass

@property
def elasticsearch(self): # pylint: disable=invalid-overridden-method
return None
Expand Down

0 comments on commit fa67e84

Please sign in to comment.