def retry_job(self, job):
     retry_job = Job(job.spec, job.iteration, self.context)
     retry_job.workload = job.workload
     retry_job.retries = job.retries + 1
     retry_job.set_status(Status.PENDING)
     self.context.job_queue.insert(0, retry_job)
     self.send(signal.JOB_RESTARTED)
Exemple #2
0
 def retry_job(self, job):
     retry_job = Job(job.spec, job.iteration, self.context)
     retry_job.workload = job.workload
     retry_job.state = job.state
     retry_job.retries = job.retries + 1
     self.context.set_job_status(retry_job, Status.PENDING, force=True)
     self.context.job_queue.insert(0, retry_job)
     self.send(signal.JOB_RESTARTED)
Exemple #3
0
    def test_job_state_transitions_pass(self):
        '''Tests state equality when the job passes first try'''
        job = Job(self.job_spec, 1, self.context)
        job.workload = Mock()

        self.context.cm._joblist = [job]
        self.context.run_state.add_job(job)

        runner = Runner(self.context, MockProcessorManager())
        runner.run()
Exemple #4
0
 def generate_jobs(self, context):
     job_specs = self.jobs_config.generate_job_specs(context.tm)
     exec_order = self.run_config.execution_order
     log.indent()
     for spec, i in permute_iterations(job_specs, exec_order):
         job = Job(spec, i, context)
         job.load(context.tm.target)
         self._jobs.append(job)
         context.run_state.add_job(job)
     log.dedent()
     self._jobs_generated = True
Exemple #5
0
 def generate_jobs(self, context):
     job_specs = self.jobs_config.generate_job_specs(context.tm)
     if not job_specs:
         msg = 'No jobs available for running.'
         raise ConfigError(msg)
     exec_order = self.run_config.execution_order
     log.indent()
     for spec, i in permute_iterations(job_specs, exec_order):
         job = Job(spec, i, context)
         job.load(context.tm.target)
         self._jobs.append(job)
         context.run_state.add_job(job)
     log.dedent()
     self._jobs_generated = True
    def test_skipped_job_state(self):
        # Test, if the first job fails and the bail parameter set,
        # that the remaining jobs have status: SKIPPED
        job_spec = get_jobspec()
        context = get_context()

        context.cm.run_config.bail_on_job_failure = True

        job1 = Job_force_retry(3, job_spec, 1, context)
        job2 = Job(job_spec, 1, context)
        job1.workload = Mock()
        job2.workload = Mock()

        context.cm._joblist = [job1, job2]
        context.run_state.add_job(job1)
        context.run_state.add_job(job2)

        runner = Runner(context, MockProcessorManager())
        try:
            runner.run()
        except ExecutionError:
            assert_equal(job2.status, Status.SKIPPED)
        else:
            assert False, "ExecutionError not raised"