amoghrajesh commented on code in PR #76904:
URL: https://github.com/apache/airflow/pull/76904#discussion_r4546126059


##########
providers/databricks/tests/unit/databricks/operators/test_databricks.py:
##########
@@ -2541,6 +2541,21 @@ def 
test_execute_complete_repair_includes_named_job_parameters(self, mock_handle
         assert repair_json_passed["job_parameters"] == {"k": "v"}
         assert mock_handle_exec.called
 
+    
@mock.patch("airflow.providers.databricks.operators.databricks.DatabricksHook")
+    def test_sync_repair_that_succeeds_does_not_fail_the_task(self, 
db_mock_class):
+        op = DatabricksRunNowOperator(durable=False, task_id=TASK_ID, 
job_id=JOB_ID, repair_run=True)
+        db_mock = db_mock_class.return_value
+        db_mock.run_now.return_value = RUN_ID
+        db_mock.get_run.side_effect = [
+            make_run_with_state_mock("TERMINATED", "FAILED").return_value,
+            make_run_with_state_mock("TERMINATED", "SUCCESS").return_value,
+        ]
+        db_mock.get_latest_repair_id.return_value = None
+
+        op.execute(None)
+
+        db_mock.repair_run.assert_called_once()

Review Comment:
   Added. It fails with 1 == 2 if the inner call is replaced by a plain return.
   
   



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to