xBis7 commented on code in PR #54103:
URL: https://github.com/apache/airflow/pull/54103#discussion_r2639198443


##########
airflow-core/tests/unit/jobs/test_scheduler_job.py:
##########
@@ -1180,6 +1226,102 @@ def 
test_find_executable_task_instances_executor_with_teams(self, dag_maker, moc
         ]
         assert len(b_tis_in_wrong_executor) == 0
 
+    def task_helper(self, dag_maker, session, dag_id: str, task_num: int):
+        dag_tasks = {}
+
+        with dag_maker(dag_id=dag_id):
+            for i in range(task_num):
+                # Assign priority weight to certain tasks.
+                if (i % 10) == 0:  # 10, 20, 30, 40, 50, ...
+                    weight = int(i / 2)
+                    dag_tasks[f"op{i}"] = EmptyOperator(task_id=f"dummy{i}", 
priority_weight=weight)
+                else:
+                    # No executor specified, runs on default executor
+                    dag_tasks[f"op{i}"] = EmptyOperator(task_id=f"dummy{i}")
+
+        dag_run = dag_maker.create_dagrun(run_type=DagRunType.SCHEDULED)
+
+        task_tis = {}
+
+        tis_list = []
+        for i in range(task_num):
+            task_tis[f"ti{i}"] = 
dag_run.get_task_instance(dag_tasks[f"op{i}"].task_id, session)
+            # add
+            tis_list.append(task_tis[f"ti{i}"])
+
+        for ti in tis_list:
+            ti.state = State.SCHEDULED
+            ti.dag_model.max_active_tasks = 4
+
+        session.flush()
+
+        return tis_list

Review Comment:
   This was a rebase mixup. It has been fixed.



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