Fix deopt fuzzer after test runner changes.

Use the same keyboard interrupt logic as run-tests.
Close the perf database explicitly after one run, as it has two runs on the same architecture. Currently the first run closes on garbage collection, which might corrupt the second run.

BUG=
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/284203002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21330 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7a520780
...@@ -319,8 +319,11 @@ def Main(): ...@@ -319,8 +319,11 @@ def Main():
for mode in options.mode: for mode in options.mode:
for arch in options.arch: for arch in options.arch:
code = Execute(arch, mode, args, options, suites, workspace) try:
exit_code = exit_code or code code = Execute(arch, mode, args, options, suites, workspace)
exit_code = exit_code or code
except KeyboardInterrupt:
return 2
return exit_code return exit_code
...@@ -409,17 +412,11 @@ def Execute(arch, mode, args, options, suites, workspace): ...@@ -409,17 +412,11 @@ def Execute(arch, mode, args, options, suites, workspace):
print "No tests to run." print "No tests to run."
return 0 return 0
try: print(">>> Collection phase")
print(">>> Collection phase") progress_indicator = progress.PROGRESS_INDICATORS[options.progress]()
progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() runner = execution.Runner(suites, progress_indicator, ctx)
runner = execution.Runner(suites, progress_indicator, ctx)
exit_code = runner.Run(options.j) exit_code = runner.Run(options.j)
if runner.terminate:
return exit_code
except KeyboardInterrupt:
return 1
print(">>> Analysis phase") print(">>> Analysis phase")
num_tests = 0 num_tests = 0
...@@ -462,19 +459,12 @@ def Execute(arch, mode, args, options, suites, workspace): ...@@ -462,19 +459,12 @@ def Execute(arch, mode, args, options, suites, workspace):
print "No tests to run." print "No tests to run."
return 0 return 0
try: print(">>> Deopt fuzzing phase (%d test cases)" % num_tests)
print(">>> Deopt fuzzing phase (%d test cases)" % num_tests) progress_indicator = progress.PROGRESS_INDICATORS[options.progress]()
progress_indicator = progress.PROGRESS_INDICATORS[options.progress]() runner = execution.Runner(suites, progress_indicator, ctx)
runner = execution.Runner(suites, progress_indicator, ctx)
exit_code = runner.Run(options.j)
if runner.terminate:
return exit_code
except KeyboardInterrupt: code = runner.Run(options.j)
return 1 return exit_code or code
return exit_code
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -138,6 +138,7 @@ class Runner(object): ...@@ -138,6 +138,7 @@ class Runner(object):
self.indicator.HasRun(test, has_unexpected_output) self.indicator.HasRun(test, has_unexpected_output)
finally: finally:
pool.terminate() pool.terminate()
self.perf_data_manager.close()
if queued_exception: if queued_exception:
raise queued_exception raise queued_exception
......
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