Test's format_result() scans stdout before it has been flushed, losing some or all keyvals.
Six tests create their keyval files by scanning the debugdir/stdout disk file created by job.run_test().
This scanning was done without any flushing of pending stdout writes, when the disk file is
shorter than its logical size. This could lead to loss of some or all keyvals, depending
on whether the system is also busy with other work at this moment.
This change was tested via twoway-container testing of simultaneous dbench and tbench jobs,
and ordinary non-container testing of bonnie. The revised btreplay, reaim, and sysbench
tests could not be tested, because their prior version was not runnable.
From: Duane Sand <duanes@google.com>
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1507 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/sysbench/sysbench.py b/client/tests/sysbench/sysbench.py
index f6651bd..968ba5e 100644
--- a/client/tests/sysbench/sysbench.py
+++ b/client/tests/sysbench/sysbench.py
@@ -87,22 +87,23 @@
profilers = self.job.profilers
if not profilers.only():
- system(cmd + ' run')
+ results = system_output(cmd + ' run') + '\n'
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- print "Profiling run ..."
- system(cmd + ' run')
+ results = "Profiling run ...\n"
+ results += system_output(cmd + ' run') + '\n'
profilers.stop(self)
profilers.report(self)
except:
system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
raise
+ print results
system(self.sudo + bin + '/pg_ctl -D ' + data + ' stop')
- self.__format_results(open(self.debugdir + '/stdout').read())
+ self.__format_results(results)
def execute_mysql(self, build, num_threads, max_time, read_only, args):
@@ -143,22 +144,23 @@
profilers = self.job.profilers
if not profilers.only():
- system(cmd + ' run')
+ results = system(cmd + ' run') + '\n'
# Do a profiling run if necessary
if profilers.present():
profilers.start(self)
- print "Profiling run ..."
- system(cmd + ' run')
+ results = "Profiling run ...\n"
+ results += system_output(cmd + ' run') + '\n'
profilers.stop(self)
profilers.report(self)
except:
system(bin + '/mysqladmin shutdown')
raise
+ print results
system(bin + '/mysqladmin shutdown')
- self.__format_results(open(self.debugdir + '/stdout').read())
+ self.__format_results(results)
def __format_results(self, results):