mdembiczak commented on code in PR #31406:
URL: https://github.com/apache/airflow/pull/31406#discussion_r1210281136


##########
tests/models/test_taskinstance.py:
##########
@@ -1770,6 +1770,59 @@ def test_get_num_running_task_instances(self, 
create_task_instance):
         assert 1 == ti2.get_num_running_task_instances(session=session)
         assert 1 == ti3.get_num_running_task_instances(session=session)
 
+    def test_get_num_running_task_instances_per_dagrun(self, 
create_task_instance, dag_maker):
+        session = settings.Session()
+
+        @task
+        def dummy_mapped_task(x: int):
+            return x
+
+        with dag_maker(dag_id="test_dag") as dag:
+            dummy_mapped_task.expand(x=[1, 2])
+            dagrun1 = dag.create_dagrun(execution_date=timezone.utcnow(),
+                                       state=DagRunState.RUNNING,
+                                       run_id="run_id_1",
+                                       session=session)

Review Comment:
   also I've tweaked the test a bit to make it more understandable



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