Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenZFS 6642 - testrunner output can be displayed in the wrong order #5777

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/test-runner/cmd/test-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#

#
# Copyright (c) 2013 by Delphix. All rights reserved.
# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
#

import ConfigParser
Expand Down Expand Up @@ -272,8 +272,10 @@ def log(self, logger, options):
else:
logger.debug('%s%s%s' % (msga, pad, msgb))

lines = self.result.stdout + self.result.stderr
for dt, line in sorted(lines):
lines = sorted(self.result.stdout + self.result.stderr,
cmp=lambda x, y: cmp(x[0], y[0]))

for dt, line in lines:
logger.debug('%s %s' % (dt.strftime("%H:%M:%S.%f ")[:11], line))

if len(self.result.stdout):
Expand All @@ -286,7 +288,7 @@ def log(self, logger, options):
os.write(err.fileno(), '%s\n' % line)
if len(self.result.stdout) and len(self.result.stderr):
with open(os.path.join(self.outputdir, 'merged'), 'w') as merged:
for _, line in sorted(lines):
for _, line in lines:
os.write(merged.fileno(), '%s\n' % line)


Expand Down