From 49066d8a132d990674bc9090a484445f6bbd6823 Mon Sep 17 00:00:00 2001 From: beats-jenkins Date: Thu, 9 May 2019 11:05:34 +0200 Subject: [PATCH] [Filebeat] Introduce UTC as default timezone for modules tests Currently all our modules have convert_timezone disable by default. The reason in 6.x for this was probably that 6.0 did not support convert_timezone and we did not want to introduce a breaking changes. New modules should have convert_timezone enabled by default. If a module has convert_timezone enabled by default the tests will fail as it takes the timezone of the local computer. To circumvent this, this PR sets the timezone of the tests to UTC so the same time zone is always used. No generated files were changed in this PR as all modules have convert_timezone off by default. But it will affect https://github.com/elastic/beats/pull/12079 and https://github.com/elastic/beats/pull/12032 --- filebeat/tests/system/test_modules.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/filebeat/tests/system/test_modules.py b/filebeat/tests/system/test_modules.py index 874c1ae35e7..6a22c8f55cf 100644 --- a/filebeat/tests/system/test_modules.py +++ b/filebeat/tests/system/test_modules.py @@ -4,6 +4,7 @@ import unittest import glob import subprocess +import time from elasticsearch import Elasticsearch import json @@ -114,6 +115,9 @@ def run_on_file(self, module, fileset, test_file, cfgfile): pass self.wait_until(lambda: not self.es.indices.exists(self.index_name)) + os.environ['TZ'] = 'Etc/UTC' + time.tzset() + cmd = [ self.filebeat, "-systemTest", "-e", "-d", "*", "-once",