shahar1 commented on code in PR #68800:
URL: https://github.com/apache/airflow/pull/68800#discussion_r3508238818
##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/executors/test_kubernetes_executor.py:
##########
@@ -2239,16 +2307,30 @@ def test_executor_with_team_name(self):
assert executor.team_name == "ml_team"
assert executor.kube_config is not None
+ @pytest.mark.skipif(
+ AirflowKubernetesScheduler is None, reason="kubernetes python package
is not installed"
+ )
@pytest.mark.skipif(not AIRFLOW_V_3_2_PLUS, reason="Multi-team requires
Airflow 3.2+")
- def test_multiple_team_executors_isolation(self, monkeypatch):
+
@mock.patch("airflow.providers.cncf.kubernetes.kube_client.get_kube_client")
+
@mock.patch("airflow.providers.cncf.kubernetes.executors.kubernetes_executor_utils.client")
+
@mock.patch("airflow.providers.cncf.kubernetes.executors.kubernetes_executor_utils.KubernetesJobWatcher")
+ def test_multiple_team_executors_isolation(
+ self, mock_watcher, mock_client, mock_kube_client, monkeypatch
+ ):
"""Test that multiple team executors can coexist with isolated
resources."""
monkeypatch.setenv("AIRFLOW__TEAM_A___KUBERNETES_EXECUTOR__WORKER_PODS_CREATION_BATCH_SIZE",
"4")
monkeypatch.setenv("AIRFLOW__TEAM_B___KUBERNETES_EXECUTOR__WORKER_PODS_CREATION_BATCH_SIZE",
"8")
team_a_executor = KubernetesExecutor(team_name="team_a")
team_b_executor = KubernetesExecutor(team_name="team_b")
+ team_a_executor.job_id = 1
+ team_b_executor.job_id = 2
try:
+ # Queues are created lazily in start(), so each team executor gets
its own.
Review Comment:
Same comment as above :)
--
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]