shahar1 commented on code in PR #72030:
URL: https://github.com/apache/airflow/pull/72030#discussion_r4432202629


##########
providers/google/tests/unit/google/cloud/operators/test_dataproc.py:
##########
@@ -1867,6 +1867,48 @@ def test_execute_deferrable(self, mock_trigger_hook, 
mock_hook):
         assert isinstance(exc.value.trigger, DataprocSubmitTrigger)
         assert exc.value.method_name == GOOGLE_DEFAULT_DEFERRABLE_METHOD_NAME
 
+    @mock.patch(DATAPROC_PATH.format("DataprocHook"))
+    @mock.patch(DATAPROC_TRIGGERS_PATH.format("DataprocAsyncHook"))
+    def test_execute_deferrable_with_execution_timeout(self, 
mock_trigger_hook, mock_hook):
+        mock_hook.return_value.submit_job.return_value.reference.job_id = 
TEST_JOB_ID
+
+        op = DataprocSubmitJobOperator(
+            task_id=TASK_ID,
+            region=GCP_REGION,
+            project_id=GCP_PROJECT,
+            job={},
+            gcp_conn_id=GCP_CONN_ID,
+            deferrable=True,
+            execution_timeout=dt.timedelta(hours=1),
+        )
+        start_date = dt.datetime(2026, 1, 1, tzinfo=dt.timezone.utc)

Review Comment:
   The test now freezes time with `time_machine` at 00:10, sets `ti.start_date` 
to 00:00 with a 1 h `execution_timeout`, and asserts both the exact 
`execution_deadline` and the exact defer timeout (`timedelta(minutes=50, 
seconds=60)`: 50 min remaining plus the 60 s buffer).



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