From 1196c2d2f0bb4d031d12c2efded1fb0fce039683 Mon Sep 17 00:00:00 2001 From: Steffen Siering Date: Mon, 13 Jul 2020 10:22:16 +0200 Subject: [PATCH] Fix parsing timestamp in Filebeat registry tests (#19796) (cherry picked from commit 0027486c1d273a74bb37c1921da26bc75cb6043a) --- filebeat/tests/system/filebeat.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/filebeat/tests/system/filebeat.py b/filebeat/tests/system/filebeat.py index ca8a8607360..52d6ea0fdda 100644 --- a/filebeat/tests/system/filebeat.py +++ b/filebeat/tests/system/filebeat.py @@ -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): """