You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/01/16 20:16:54 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #13712: Fix backfill crash on task retry or reschedule

kaxil commented on a change in pull request #13712:
URL: https://github.com/apache/airflow/pull/13712#discussion_r559033498



##########
File path: tests/jobs/test_backfill_job.py
##########
@@ -683,6 +685,61 @@ def test_backfill_rerun_failed_tasks_without_flag(self):
         with self.assertRaises(AirflowException):
             job.run()
 
+    def test_backfill_retry_intermittent_failed_task(self):
+        dag = DAG(
+            dag_id='test_intermittent_failure_job',
+            start_date=DEFAULT_DATE,
+            schedule_interval="@daily",
+            default_args={
+                'retries': 2,
+                'retry_delay': datetime.timedelta(seconds=0),
+            },
+        )
+        task1 = DummyOperator(task_id="task1", dag=dag)
+        dag.clear()
+
+        executor = MockExecutor(parallelism=16)
+        executor.mock_task_results[
+            TaskInstanceKey(dag.dag_id, task1.task_id, DEFAULT_DATE, try_number=1)
+        ] = State.UP_FOR_RETRY
+        executor.mock_task_results[
+            TaskInstanceKey(dag.dag_id, task1.task_id, DEFAULT_DATE, try_number=2)
+        ] = State.UP_FOR_RETRY

Review comment:
       Shouldn't the first try be failed for it to go to try_number 2?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org