clean up error counting and reporting

pull/8397/head
Alex Polcyn 8 years ago
parent 497966787a
commit cac93f673e
  1. 13
      tools/run_tests/run_performance_tests.py

@ -353,6 +353,7 @@ def create_scenarios(languages, workers_by_lang, remote_host=None, regex='.*',
return scenarios return scenarios
def finish_qps_workers(jobs): def finish_qps_workers(jobs):
"""Waits for given jobs to finish and eventually kills them.""" """Waits for given jobs to finish and eventually kills them."""
retries = 0 retries = 0
@ -451,7 +452,8 @@ scenarios = create_scenarios(languages,
if not scenarios: if not scenarios:
raise Exception('No scenarios to run') raise Exception('No scenarios to run')
num_failures = 0 total_scenario_failures = 0
total_jobs_killed = 0
for scenario in scenarios: for scenario in scenarios:
if args.dry_run: if args.dry_run:
print(scenario.name) print(scenario.name)
@ -459,13 +461,14 @@ for scenario in scenarios:
try: try:
for worker in scenario.workers: for worker in scenario.workers:
worker.start() worker.start()
jobset_failures, _ = jobset.run([scenario.jobspec, scenario_failures, _ = jobset.run([scenario.jobspec,
create_quit_jobspec(scenario.workers, remote_host=args.remote_driver_host)], create_quit_jobspec(scenario.workers, remote_host=args.remote_driver_host)],
newline_on_success=True, maxjobs=1) newline_on_success=True, maxjobs=1)
num_failures += jobset_failures total_scenario_failures += scenario_failures
finally: finally:
# Consider jobs that need to be killed as failures # Consider jobs that need to be killed as failures
num_failures += finish_qps_workers(scenario.workers) total_jobs_killed += finish_qps_workers(scenario.workers)
if num_failures > 0: if num_failures > 0:
raise Exception('Failures occured') print(str(total_scenario_failures) + " scenarios failed and " + str(total_jobs_killed) + " jobs killed")
sys.exit(1)

Loading…
Cancel
Save