def test_get_next_pending_job(self): job1_id = dataset_eval._create_job(self.conn, self.test_dataset_id, True, dataset_eval.EVAL_LOCAL, c_value=[1, 2, 3], gamma_value=[4, 5, 6], preprocessing_values=["basic"], filter_type=None) job1 = dataset_eval.get_job(job1_id) job2_id = dataset_eval._create_job(self.conn, self.test_dataset_id, True, dataset_eval.EVAL_LOCAL, c_value=[1, 2, 3], gamma_value=[4, 5, 6], preprocessing_values=["basic"], filter_type=None) job2 = dataset_eval.get_job(job2_id) next_pending = dataset_eval.get_next_pending_job() self.assertEqual(job1, next_pending) dataset_eval.set_job_status( job_id=job1_id, status=dataset_eval.STATUS_FAILED, ) next_pending = dataset_eval.get_next_pending_job() self.assertEqual(job2, next_pending)
def test_get_next_pending_job(self): job1_id = dataset_eval._create_job(self.conn, self.test_dataset_id) job1 = dataset_eval.get_job(job1_id) job2_id = dataset_eval._create_job(self.conn, self.test_dataset_id) job2 = dataset_eval.get_job(job2_id) next_pending = dataset_eval.get_next_pending_job() self.assertEqual(job1, next_pending) dataset_eval.set_job_status( job_id=job1_id, status=dataset_eval.STATUS_FAILED, ) next_pending = dataset_eval.get_next_pending_job() self.assertEqual(job2, next_pending)
def test_get_next_pending_job_remote(self): # If we have a remote pending job with the most recent timestamp, skip it job1_id = dataset_eval._create_job(self.conn, self.test_dataset_id, True, dataset_eval.EVAL_REMOTE) job1 = dataset_eval.get_job(job1_id) job2_id = dataset_eval._create_job(self.conn, self.test_dataset_id, True, dataset_eval.EVAL_LOCAL) job2 = dataset_eval.get_job(job2_id) next_pending = dataset_eval.get_next_pending_job() self.assertEqual(job2, next_pending)
def test_get_next_pending_job_remote(self): # If we have a remote pending job with the most recent timestamp, skip it job1_id = dataset_eval._create_job(self.conn, self.test_dataset_id, True, dataset_eval.EVAL_REMOTE, c_value=[1, 2, 3], gamma_value=[4, 5, 6], preprocessing_values=["basic"], filter_type=None) job1 = dataset_eval.get_job(job1_id) job2_id = dataset_eval._create_job(self.conn, self.test_dataset_id, True, dataset_eval.EVAL_LOCAL, c_value=[1, 2, 3], gamma_value=[4, 5, 6], preprocessing_values=["basic"], filter_type=None) job2 = dataset_eval.get_job(job2_id) next_pending = dataset_eval.get_next_pending_job() self.assertEqual(job2, next_pending)