Skip to content

Commit

Permalink
Fix intermittent mlogfilter test failure (#649)
Browse files Browse the repository at this point in the history
Fix intermittent mlogfilter test failures by specifying microseconds
  • Loading branch information
kevinadi authored and stennie committed Jul 4, 2018
1 parent 973c346 commit 0fe5080
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions mtools/test/test_mlogfilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_from(self):
random_start = random_date(self.logfile.start, self.logfile.end)
self.tool.run('%s --from '
'%s' % (self.logfile_path,
random_start.strftime("%b %d %H:%M:%S")))
random_start.strftime("%b %d %H:%M:%S.%f")))
output = sys.stdout.getvalue()
for line in output.splitlines():
le = LogEvent(line)
Expand All @@ -74,8 +74,8 @@ def test_from_to(self):

self.tool.run('%s --from %s --to '
'%s' % (self.logfile_path,
random_start.strftime("%b %d %H:%M:%S"),
random_end.strftime("%b %d %H:%M:%S")))
random_start.strftime("%b %d %H:%M:%S.%f"),
random_end.strftime("%b %d %H:%M:%S.%f")))
output = sys.stdout.getvalue()
for line in output.splitlines():
le = LogEvent(line)
Expand All @@ -97,8 +97,8 @@ def test_from_to_26_log(self):

self.tool.run('%s --from %s --to '
'%s' % (logfile_26_path,
random_start.strftime("%b %d %H:%M:%S"),
random_end.strftime("%b %d %H:%M:%S")))
random_start.strftime("%b %d %H:%M:%S.%f"),
random_end.strftime("%b %d %H:%M:%S.%f")))
output = sys.stdout.getvalue()
assert len(output.splitlines()) > 0

Expand All @@ -119,8 +119,8 @@ def test_from_to_stdin(self):
self.tool.is_stdin = True
self.tool.run('%s --from %s --to '
'%s' % (self.logfile_path,
start.strftime("%b %d %H:%M:%S"),
end.strftime("%b %d %H:%M:%S")))
start.strftime("%b %d %H:%M:%S.%f"),
end.strftime("%b %d %H:%M:%S.%f")))
self.tool.is_stdin = False

output = sys.stdout.getvalue()
Expand Down

0 comments on commit 0fe5080

Please sign in to comment.