kaxil commented on code in PR #44907:
URL: https://github.com/apache/airflow/pull/44907#discussion_r1890070376


##########
tests/api_fastapi/execution_api/routes/test_task_instances.py:
##########
@@ -286,6 +286,57 @@ def test_ti_update_state_to_deferred(self, client, 
session, create_task_instance
         assert t[0].classpath == "my-classpath"
         assert t[0].kwargs == {"key": "value"}
 
+    def test_ti_update_state_to_reschedule(self, client, session, 
create_task_instance, time_machine):
+        """
+        Test that tests if the transition to reschedule state is handled 
correctly.
+        """
+
+        from math import ceil
+
+        instant = timezone.datetime(2024, 10, 30)
+        time_machine.move_to(instant, tick=False)
+
+        ti = create_task_instance(
+            task_id="test_ti_update_state_to_reschedule",
+            state=State.RUNNING,
+            session=session,
+        )
+        ti.start_date = instant
+        ti.end_date = DEFAULT_END_DATE

Review Comment:
   Hmm this shouldn't be set already since task is marked as running



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