From e48a91b26740325781907da837ebf7315beec560 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 11 Sep 2018 00:10:14 +0800 Subject: [PATCH] worker: do not pass --timeout to first-in-suite job likewise, do not pass --seed or --subset to last-in-suite job otherwise, teuthology/schedule.py will raise a ValueError at seeing --subset or --seed not coming along with --first-in-suite, or --email or --timeout not coming along with --last-in-suite. Signed-off-by: Kefu Chai --- teuthology/worker.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/teuthology/worker.py b/teuthology/worker.py index 351f47e97b..401f9d3930 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -193,23 +193,26 @@ def run_job(job_config, teuth_bin_path, archive_dir, verbose): if job_config.get('first_in_suite') or job_config.get('last_in_suite'): if teuth_config.results_server: report.try_delete_jobs(job_config['name'], job_config['job_id']) - log.info('Generating memo/results for %s', job_config['name']) args = [ os.path.join(teuth_bin_path, 'teuthology-results'), - '--timeout', - str(job_config.get('results_timeout', - teuth_config.results_timeout)), '--archive-dir', os.path.join(archive_dir, safe_archive), '--name', job_config['name'], ] - if job_config.get('email'): - args.extend(['--email', job_config['email']]) - if job_config.get('seed'): - args.extend(['--seed', job_config['seed']]) - if job_config.get('subset'): - args.extend(['--subset', job_config['subset']]) + if job_config.get('first_in_suite'): + log.info('Generating memo for %s', job_config['name']) + if job_config.get('seed'): + args.extend(['--seed', job_config['seed']]) + if job_config.get('subset'): + args.extend(['--subset', job_config['subset']]) + else: + log.info('Generating results for %s', job_config['name']) + timeout = job_config.get('results_timeout', + teuth_config.results_timeout) + args.extend(['--timeout', str(timeout)]) + if job_config.get('email'): + args.extend(['--email', job_config['email']]) # Execute teuthology-results, passing 'preexec_fn=os.setpgrp' to # make sure that it will continue to run if this worker process # dies (e.g. because of a restart) -- 2.39.5