]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
worker: do not pass --timeout to first-in-suite job 1204/head
authorKefu Chai <kchai@redhat.com>
Mon, 10 Sep 2018 16:10:14 +0000 (00:10 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 10 Sep 2018 16:12:28 +0000 (00:12 +0800)
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 <kchai@redhat.com>
teuthology/worker.py

index 351f47e97b0d8bdac3314aa9ed21640c5dd4e7dc..401f9d39308db7d95b14e17de22d6fc01b5b690e 100644 (file)
@@ -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)