Files
airflow/devel-common
Kaxil Naik 72ac4fb4f1 Stop loading the task runner on every Airflow process startup (#74496)
mask_secret() imported airflow.sdk.execution_time.task_runner only to check
whether SUPERVISOR_COMMS is set. settings.initialize() masks sensitive config
values at startup, so every CLI command and every scheduler, API server and
dag-processor start paid for importing the whole task runtime, including a
second provider discovery for the SDK configuration. Every process that sets
SUPERVISOR_COMMS has already imported task_runner, so it is now read from
sys.modules instead.

* Make non-DB tests independent of the task runner being imported at startup

Masking a config value at startup no longer imports the task runner, and
non-DB tests had quietly relied on that import:

- configure_orm() never succeeds against the bad connection string non-DB
  tests use, so the hook that imports every model before SQLAlchemy
  configures mappers was never installed. The task runner import was what
  registered DagBundleModel, so Team.dag_bundles stopped resolving and the
  first ORM object built in a worker failed every later test. Install the
  same hook in the pytest plugin for non-DB runs.
- test_execute_deferrable patched builtins.open for the whole process. The
  task runner is now first imported inside execute(), so the metrics
  registry read the mocked file instead of its YAML. Patch open only in
  the module that reads the kube config.
2026-10-12 00:18:33 +01:00
..