"""
import docopt
+import sys
import teuthology.dispatcher
def main():
args = docopt.docopt(__doc__)
- teuthology.dispatcher.main(args)
+ sys.exit(teuthology.dispatcher.main(args))
fetch_qa_suite('master')
keep_running = True
+ job_procs = set()
while keep_running:
# Check to see if we have a teuthology-results process hanging around
# and if so, read its return code so that it can exit.
if job is None:
continue
+ job_procs = set(filter(lambda p: p.poll() is None, job_procs))
+
# bury the job so it won't be re-run if it fails
job.bury()
job_id = job.jid
try:
job_proc = subprocess.Popen(run_args)
+ job_procs.add(job_proc)
log.info('Job supervisor PID: %s', job_proc.pid)
except Exception:
error_message = "Saw error while trying to spawn supervisor."
except Exception:
log.exception("Saw exception while trying to delete job")
+ returncodes = set([0])
+ for proc in job_procs:
+ if proc.returncode is not None:
+ returncodes.add(proc.returncode)
+ return max(returncodes)
+
def lock_machines(job_config):
report.try_push_job_info(job_config, dict(status='running'))
yaml.safe_dump(job_config, f, default_flow_style=False)
try:
- run_job(
+ return run_job(
job_config,
teuth_bin_path,
archive_dir,
verbose
)
except SkipJob:
- return
+ return 0
def run_job(job_config, teuth_bin_path, archive_dir, verbose):
log.info('Success!')
if 'targets' in job_config:
unlock_targets(job_config)
+ return p.returncode
def failure_is_reimage(failure_reason):
if not failure_reason: