ephraimbuddy commented on code in PR #74793:
URL: https://github.com/apache/airflow/pull/74793#discussion_r4490969563


##########
airflow-core/tests/unit/dag_processing/test_manager_api_results.py:
##########
@@ -0,0 +1,113 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from __future__ import annotations
+
+import signal
+import time
+from pathlib import Path
+from unittest import mock
+
+import pytest
+from uuid6 import uuid7
+
+from airflow.dag_processing.api_client import DagProcessorAPIClient
+from airflow.dag_processing.manager import DagFileInfo, 
DagFileProcessorManager, DagFileStat
+from airflow.dag_processing.processor import DagFileParsingResult, 
DagFileProcessorProcess, DagParseSource
+from airflow.sdk import timezone
+
+
[email protected]("outcome", ["parsed", "callback", "failed", "stale", 
"stale_failure"])
[email protected]("airflow.settings.Session", autospec=True, 
side_effect=AssertionError("Unexpected DB session"))
+def test_api_result_collection_does_not_create_database_session(
+    session_factory, outcome, tmp_path, time_machine
+):
+    time_machine.move_to("2026-10-05T12:00:00Z", tick=False)
+    client = mock.create_autospec(DagProcessorAPIClient, instance=True)
+    manager = DagFileProcessorManager(max_runs=1, api_client=client)
+    time_machine.shift(manager.stale_dag_threshold + 1)

Review Comment:
   Not needed any more: both shifts only got past the hold-back. Removed them, 
and the tests pass without them. The shift in 
`test_failed_parse_publishes_an_error_and_ages_out_prior_dags` stays, since 
that test needs the Dags to outlast the server's `stale_dag_threshold` cutoff. 
Fixed in 5c9861c736.
   



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