Skip to content

Commit

Permalink
Fix parsing timestamp in Filebeat registry tests (elastic#19796)
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffen Siering authored and melchiormoulin committed Oct 14, 2020
1 parent ba8f633 commit 1bb321d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion filebeat/tests/system/filebeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ def has_registry(self, name=None, data_path=None):
def get_registry(self, name=None, data_path=None, filter=None):
reg = self.access_registry(name, data_path)
self.wait_until(reg.exists)
return reg.load(filter=filter)

def parse_entry(entry):
extra, sec = entry["timestamp"]
nsec = extra & 0xFFFFFFFF
entry["timestamp"] = sec + (nsec / 1000000000)
return entry

entries = [parse_entry(entry) for entry in reg.load(filter=filter)]
return entries

def get_registry_entry_by_path(self, path):
"""
Expand Down

0 comments on commit 1bb321d

Please sign in to comment.