Commit 9332a3a5 authored by Julien Muchembled's avatar Julien Muchembled

Do not leave SQLite DB files at the end of perf tests if no error happened

parent 20dae799
...@@ -108,9 +108,11 @@ class MatrixImportBenchmark(BenchmarkRunner): ...@@ -108,9 +108,11 @@ class MatrixImportBenchmark(BenchmarkRunner):
self._size = size self._size = size
else: else:
assert self._size == size assert self._size == size
return end - start
finally: finally:
neo.stop() neo.stop()
# Clear DB if no error happened.
neo.setupDB()
return end - start
except: except:
traceback.print_exc() traceback.print_exc()
self.error_log += "Import with m=%s, s=%s, r=%s, p=%s:" % ( self.error_log += "Import with m=%s, s=%s, r=%s, p=%s:" % (
......
...@@ -47,18 +47,18 @@ class ImportBenchmark(BenchmarkRunner): ...@@ -47,18 +47,18 @@ class ImportBenchmark(BenchmarkRunner):
master_count=config.masters, master_count=config.masters,
verbose=False, verbose=False,
) )
# import datafs # import datafs
neo.start()
try: try:
neo.start()
try: try:
return self.buildReport(*self.runImport(neo)) result = self.buildReport(*self.runImport(neo))
except: finally:
summary = 'Perf : import failed' neo.stop()
report = ''.join(traceback.format_exc()) # Clear DB if no error happened.
return summary, report neo.setupDB()
finally: return result
neo.stop() except:
return 'Perf: import failed', ''.join(traceback.format_exc())
def runImport(self, neo): def runImport(self, neo):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment