Skip to content

Commit

Permalink
[chore][metricbeat/test_diskio]: fix CI failure (#41580) (#41628)
Browse files Browse the repository at this point in the history
* chore: fix CI failure

* lint

* bug

(cherry picked from commit 56dca4b)

Co-authored-by: Vihas Makwana <121151420+VihasMakwana@users.noreply.github.com>
  • Loading branch information
mergify[bot] and VihasMakwana authored Nov 13, 2024
1 parent 96968c9 commit 9acb569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions metricbeat/module/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ def test_diskio(self):
if 'error' not in evt:
if "system" in evt:
diskio = evt["system"]["diskio"]
self.remove_fields(diskio, ["serial_number"])
self.assert_fields_for_platform(SYSTEM_DISKIO, diskio)
elif "host" in evt:
host_disk = evt["host"]["disk"]
Expand Down
5 changes: 5 additions & 0 deletions metricbeat/tests/system/metricbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ def check_metricset(self, module, metricset, hosts, fields: list = None, extras:

self.assert_fields_are_documented(evt)

def remove_fields(self, event: object, fields: list):
for field in fields:
if field in event:
del event[field]


def supported_versions(path):
"""
Expand Down

0 comments on commit 9acb569

Please sign in to comment.