SameerMesiah97 commented on code in PR #77129:
URL: https://github.com/apache/airflow/pull/77129#discussion_r4580141952


##########
providers/standard/tests/unit/standard/triggers/test_external_task.py:
##########
@@ -119,6 +119,59 @@ async def test_task_workflow_trigger_failed(self, 
mock_get_count):
         with pytest.raises(StopAsyncIteration):
             await gen.__anext__()
 
+    @pytest.mark.parametrize(
+        ("failed_states", "skipped_states", "count", "expected_status", 
"expected_states"),
+        [
+            (["failed"], None, 1, "failed", ["failed"]),
+            (None, ["skipped"], 1, "skipped", ["skipped"]),
+            (None, None, 2, "success", ["success"]),
+        ],
+        ids=["partial-failure", "partial-skip", "all-tasks-allowed"],
+    )
+    
@mock.patch("airflow.sdk.execution_time.task_runner.RuntimeTaskInstance.get_ti_count")
+    @mock.patch(
+        "airflow.providers.standard.triggers.external_task.asyncio.sleep", 
new_callable=mock.AsyncMock
+    )
+    @pytest.mark.asyncio
+    async def test_task_workflow_trigger_multiple_task_counts(

Review Comment:
   Can you extend the parametrization to cover the success threshold more 
directly? For example, with two tasks across three runs, an allowed count of 
five should keep polling and six should emit success. Please also cover one of 
two tasks succeeding in a single run. The existing failure/skip cases cover the 
original bug, but these would protect the new `len(task_ids) * len(runs)` 
calculation and ensure partial success cannot finish the trigger early.



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