ashb commented on a change in pull request #22214:
URL: https://github.com/apache/airflow/pull/22214#discussion_r825336536



##########
File path: tests/dag_processing/test_processor.py
##########
@@ -222,15 +222,47 @@ def 
test_dag_file_processor_sla_miss_doesnot_raise_integrity_error(self, dag_mak
 
         dag_file_processor = DagFileProcessor(dag_ids=[], log=mock.MagicMock())
         dag_file_processor.manage_slas(dag=dag, session=session)
-        sla_miss_count = (
+        sla_misses = (
             session.query(SlaMiss)
             .filter(
                 SlaMiss.dag_id == dag.dag_id,
                 SlaMiss.task_id == task.task_id,
             )
-            .count()
+            .all()
         )
-        assert sla_miss_count == 1
+        assert len(sla_misses) == 1
+        created_sla_miss = sla_misses[0]
+
+        # the SlaMiss created is for the _next_ TI
+        assert created_sla_miss.execution_date == test_start_date + 
datetime.timedelta(days=1)

Review comment:
       This is the current behaviour, but that seems.... wrong? How can a task 
that doesn't exist have breached it's SLA? (I guess if the TI isn't created)
   
   But I would have assumes that the execution date of the SLA miss should have 
been the one for the TI that does exist in this test 🤔 




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