amoghrajesh commented on code in PR #76493:
URL: https://github.com/apache/airflow/pull/76493#discussion_r4752937184
##########
airflow-core/tests/unit/api_fastapi/core_api/test_security.py:
##########
@@ -438,19 +458,18 @@ def
test_requires_access_dag_from_file_token_no_dag_reparse_forbidden(
@pytest.mark.db_test
@pytest.mark.asyncio
- @patch.object(DagModel, "get_team_name")
+ @patch.object(DagModel, "get_team_name_async")
Review Comment:
Add `autospec=True` so a wrong call signature fails
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_backfills.py:
##########
@@ -1809,3 +1809,49 @@ def test_invalid_id(self, test_client):
assert (
response_detail["msg"] == "Input should be a valid integer, unable
to parse string as an integer"
)
+
+
+class TestBackfillAuthorizationOffEventLoop(TestBackfillEndpoint):
+ """
Review Comment:
Cant this docstring be short like:
```
``requires_access_backfill`` must not run sync SQL on the event loop. The
sweep in ``test_event_loop_blocking.py`` uses an empty DB, so it misses the
team lookup and the query-string and body ``dag_id`` routes.
```
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_backfills.py:
##########
@@ -1809,3 +1809,49 @@ def test_invalid_id(self, test_client):
assert (
response_detail["msg"] == "Input should be a valid integer, unable
to parse string as an integer"
)
+
+
+class TestBackfillAuthorizationOffEventLoop(TestBackfillEndpoint):
+ """
+ ``requires_access_backfill`` is an async dependency, so its lookups must
not run sync SQL on the
+ event loop: a blocked loop cannot release the connections the sync
handlers hold, see
+ https://github.com/apache/airflow/issues/76425.
Review Comment:
Remove the issue URL here.
--
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]