thelioo commented on code in PR #76651:
URL: https://github.com/apache/airflow/pull/76651#discussion_r4502617891


##########
airflow-core/tests/unit/dag_processing/test_manager.py:
##########
@@ -3676,6 +3676,23 @@ def 
test_collect_results_processes_remaining_files_when_one_persist_fails(
         assert manager._file_stats[file_b].run_count == 2
         assert len(manager._processors) == 0
 
+    def test_collect_results_decrements_processes_metric(self):
+        manager = DagFileProcessorManager(max_runs=1)
+        file = DagFileInfo(bundle_name="testing", rel_path=Path("a.py"), 
bundle_path=TEST_DAGS_FOLDER)
+        manager._file_stats[file] = DagFileStat()
+        proc, _ = self.mock_processor(start_time=time.monotonic() - 1)
+        proc.had_callbacks = True
+        manager._processors[file] = proc
+
+        with mock.patch("airflow.dag_processing.manager.stats.decr") as 
stats_decr_mock:

Review Comment:
   Thanks, done in adffea9f. The test is now 
`TestMultiTeamMetrics.test_collect_results_includes_team_name`, parametrized 
with and without a team, with `stats.decr` and `get_team_names` patched by 
decorators. I checked that the `with_team` case fails when `team_name` is 
removed from the new `decr`.
   



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