Skip to content

Commit

Permalink
[Filebeat] Introduce UTC as default timezone for modules tests
Browse files Browse the repository at this point in the history
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 elastic#12079 and elastic#12032
  • Loading branch information
ruflin committed May 9, 2019
1 parent ccbf05a commit 49066d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions filebeat/tests/system/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest
import glob
import subprocess
import time

from elasticsearch import Elasticsearch
import json
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 49066d8

Please sign in to comment.