LiamHecht commented on code in PR #75562:
URL: https://github.com/apache/airflow/pull/75562#discussion_r4371319992


##########
airflow-core/tests/unit/models/test_trigger.py:
##########
@@ -180,6 +180,65 @@ def test_clean_unused(session, dag_maker):
     assert {result.id for result in results} == {trigger1.id, trigger4.id, 
trigger5.id, trigger6.id}
 
 
[email protected]("reference_type", ["task-instance", "asset-watcher", 
"callback"])
+def test_clean_unused_rechecks_new_references(session, create_task_instance, 
reference_type):
+    """A trigger referenced after the unused ids are read must not be deleted 
(#72061)."""
+    trigger = Trigger(classpath="airflow.triggers.testing.SuccessTrigger", 
kwargs={})
+    session.add(trigger)
+    session.commit()
+    trigger_id = trigger.id
+
+    if reference_type == "task-instance":
+        task_instance = create_task_instance(

Review Comment:
   Agreed, I'll split it into three separate tests, one per reference type.



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