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


##########
providers/google/tests/system/google/cloud/composer/example_cloud_composer.py:
##########
@@ -310,7 +310,7 @@ def cleanup_failed_environment_before_retry(context: 
dict[str, Any]) -> None:
         composer_external_dag_id="airflow_monitoring",
         composer_external_task_id="echo",
         allowed_states=["success"],
-        execution_range=timedelta(days=1),
+        execution_range=[datetime.now(tz=UTC) - timedelta(1), 
datetime.now(tz=UTC)],

Review Comment:
   **major**: Quality signals 
(`.github/instructions/code-review.instructions.md`): *"**No evidence of 
testing**: Claims of fixes without test evidence, or author admitting they 
cannot run the test suite."*
   
   This fixes runs where the task process parses the Dag file again: a real 
scheduler, or `_AIRFLOW__SYSTEM_TEST_USE_EXECUTOR=1`. There, `now()` is 
computed after `trigger_dag_run`.
   
   The default system test mode has no executor and does not parse again. 
`dag.test()` runs the task object built at import, so both `now()` calls keep 
their import-time values. I confirmed that with a small local Dag: the window 
end stayed at import time, behind the task's start. Here that means the window 
ends before the Composer environment and the triggered run exist. 
`_get_task_instances` then returns nothing and both sensors keep waiting, as 
they do on main. I have not run this against Composer.
   
   The run reported on 2026-10-15 was on 3698ea7, with naive `datetime.now()`. 
`strftime("...Z")` labels that local time as UTC, which moves the query end 
into the future east of UTC, and that may be why it passed. Was the tz-aware 
head run, and in which mode?
   
   A window end in the future works in both modes, because `poke` and 
`CloudComposerExternalTaskTrigger` never wait for `end_date` to pass:
   
   ```suggestion
           execution_range=[datetime.now(tz=UTC) - timedelta(days=1), 
datetime.now(tz=UTC) + timedelta(days=1)],
   ```



##########
providers/google/tests/system/google/cloud/composer/example_cloud_composer.py:
##########
@@ -323,7 +323,7 @@ def cleanup_failed_environment_before_retry(context: 
dict[str, Any]) -> None:
         composer_external_dag_id="airflow_monitoring",
         composer_external_task_id="echo",
         allowed_states=["success"],
-        execution_range=timedelta(days=1),
+        execution_range=[datetime.now(tz=UTC) - timedelta(1), 
datetime.now(tz=UTC)],

Review Comment:
   Same change as line 313, for the deferrable sensor:
   
   ```suggestion
           execution_range=[datetime.now(tz=UTC) - timedelta(days=1), 
datetime.now(tz=UTC) + timedelta(days=1)],
   ```



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