This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch revert-43100-fix-flaky-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 93c0a7a1856269c3f1450bad9ba13761227df8ae
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Thu Oct 17 09:53:07 2024 +0200

    Revert "Fix flaky `test_get_dags` in FastAPI routes (#43100)"
    
    This reverts commit 2b21e88a62297eff1ce7b2051d368eb809ef7513.
---
 .../core_api/routes/public/test_dags.py            | 44 +++++++++++-----------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/tests/api_fastapi/core_api/routes/public/test_dags.py 
b/tests/api_fastapi/core_api/routes/public/test_dags.py
index e365c4d5e4..edc350c27b 100644
--- a/tests/api_fastapi/core_api/routes/public/test_dags.py
+++ b/tests/api_fastapi/core_api/routes/public/test_dags.py
@@ -135,37 +135,37 @@ class TestGetDags(TestDagEndpoint):
         "query_params, expected_total_entries, expected_ids",
         [
             # Filters
-            ({}, 2, {DAG1_ID, DAG2_ID}),
-            ({"limit": 1}, 2, {DAG1_ID}),
-            ({"offset": 1}, 2, {DAG2_ID}),
-            ({"tags": ["example"]}, 1, {DAG1_ID}),
-            ({"only_active": False}, 3, {DAG1_ID, DAG2_ID, DAG3_ID}),
-            ({"paused": True, "only_active": False}, 1, {DAG3_ID}),
-            ({"paused": False}, 2, {DAG1_ID, DAG2_ID}),
-            ({"owners": ["airflow"]}, 2, {DAG1_ID, DAG2_ID}),
-            ({"owners": ["test_owner"], "only_active": False}, 1, {DAG3_ID}),
-            ({"last_dag_run_state": "success", "only_active": False}, 1, 
{DAG3_ID}),
-            ({"last_dag_run_state": "failed", "only_active": False}, 1, 
{DAG1_ID}),
+            ({}, 2, [DAG1_ID, DAG2_ID]),
+            ({"limit": 1}, 2, [DAG1_ID]),
+            ({"offset": 1}, 2, [DAG2_ID]),
+            ({"tags": ["example"]}, 1, [DAG1_ID]),
+            ({"only_active": False}, 3, [DAG1_ID, DAG2_ID, DAG3_ID]),
+            ({"paused": True, "only_active": False}, 1, [DAG3_ID]),
+            ({"paused": False}, 2, [DAG1_ID, DAG2_ID]),
+            ({"owners": ["airflow"]}, 2, [DAG1_ID, DAG2_ID]),
+            ({"owners": ["test_owner"], "only_active": False}, 1, [DAG3_ID]),
+            ({"last_dag_run_state": "success", "only_active": False}, 1, 
[DAG3_ID]),
+            ({"last_dag_run_state": "failed", "only_active": False}, 1, 
[DAG1_ID]),
             # # Sort
-            ({"order_by": "-dag_id"}, 2, {DAG2_ID, DAG1_ID}),
-            ({"order_by": "-dag_display_name"}, 2, {DAG2_ID, DAG1_ID}),
-            ({"order_by": "dag_display_name"}, 2, {DAG1_ID, DAG2_ID}),
-            ({"order_by": "next_dagrun", "only_active": False}, 3, {DAG3_ID, 
DAG1_ID, DAG2_ID}),
-            ({"order_by": "last_run_state", "only_active": False}, 3, 
{DAG1_ID, DAG3_ID, DAG2_ID}),
-            ({"order_by": "-last_run_state", "only_active": False}, 3, 
{DAG3_ID, DAG1_ID, DAG2_ID}),
+            ({"order_by": "-dag_id"}, 2, [DAG2_ID, DAG1_ID]),
+            ({"order_by": "-dag_display_name"}, 2, [DAG2_ID, DAG1_ID]),
+            ({"order_by": "dag_display_name"}, 2, [DAG1_ID, DAG2_ID]),
+            ({"order_by": "next_dagrun", "only_active": False}, 3, [DAG3_ID, 
DAG1_ID, DAG2_ID]),
+            ({"order_by": "last_run_state", "only_active": False}, 3, 
[DAG1_ID, DAG3_ID, DAG2_ID]),
+            ({"order_by": "-last_run_state", "only_active": False}, 3, 
[DAG3_ID, DAG1_ID, DAG2_ID]),
             (
                 {"order_by": "last_run_start_date", "only_active": False},
                 3,
-                {DAG1_ID, DAG3_ID, DAG2_ID},
+                [DAG1_ID, DAG3_ID, DAG2_ID],
             ),
             (
                 {"order_by": "-last_run_start_date", "only_active": False},
                 3,
-                {DAG3_ID, DAG1_ID, DAG2_ID},
+                [DAG3_ID, DAG1_ID, DAG2_ID],
             ),
             # Search
-            ({"dag_id_pattern": "1"}, 1, {DAG1_ID}),
-            ({"dag_display_name_pattern": "test_dag2"}, 1, {DAG2_ID}),
+            ({"dag_id_pattern": "1"}, 1, [DAG1_ID]),
+            ({"dag_display_name_pattern": "test_dag2"}, 1, [DAG2_ID]),
         ],
     )
     def test_get_dags(self, test_client, query_params, expected_total_entries, 
expected_ids):
@@ -175,7 +175,7 @@ class TestGetDags(TestDagEndpoint):
         body = response.json()
 
         assert body["total_entries"] == expected_total_entries
-        assert set(dag["dag_id"] for dag in body["dags"]) == expected_ids
+        assert [dag["dag_id"] for dag in body["dags"]] == expected_ids
 
 
 class TestPatchDag(TestDagEndpoint):

Reply via email to