ashb commented on a change in pull request #22214:
URL: https://github.com/apache/airflow/pull/22214#discussion_r825337610
##########
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:
It looks like it's been like this _for ever_
https://github.com/apache/airflow/commit/60f35c3aeca6206233eec8c3371c797824a9f2f8
But then there's also been lots of reports that SLA is not working right,
and maybe this might be part of why?
--
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]