aringeri opened a new issue, #64884:
URL: https://github.com/apache/airflow/issues/64884

   ### Under which category would you file this issue?
   
   Airflow Core
   
   ### Apache Airflow version
   
   3.0.6
   
   ### What happened and how to reproduce it?
   
   I am unable to execute unit tests for dags that call the 
TriggerDagRunOperator. See my minimal reproducible code below:
   
   ### DAG definitions (`./tests/unit/dags/multi_dag.py`)
   ```python
   from airflow.decorators import dag
   from airflow.providers.standard.operators.python import PythonOperator
   from airflow.providers.standard.operators.trigger_dagrun import 
TriggerDagRunOperator
   
   
   def print_func():
       print("Hello from task")
   
   @dag(is_paused_upon_creation=False)
   def other_dag():
       PythonOperator(
           task_id="python_func",
           python_callable=print_func
         )
   
   @dag(is_paused_upon_creation=False)
   def parent_dag() -> None:
       TriggerDagRunOperator(
           trigger_dag_id="other_dag",
           task_id="trigger_other",
           conf={"msg": "hello"},
       )
   
   
   parent_dag()
   other_dag()
   ```
   
   ### Test Code (`./tests/unit/test_multi_dag.py`)
   ```python
   from pathlib import Path
   
   def test_dag_trigger():
       from airflow.models import DagBag
       from airflow.utils.state import State
   
       dag_bag = DagBag(
           dag_folder=Path(__file__).parent / "dags",
           include_examples=False,
       )
       dag = dag_bag.get_dag(dag_id="parent_dag")
       assert dag is not None
       run = dag.test()
       assert run.state == State.SUCCESS
   ```
   
   I see the following errors in the logs. This seems to indicate that the 
in-process API used for testing does not handle POST to `POST 
http://in-process.invalid./dag-runs/<dag-id>/<run-id>`
   
   ```
   2026-04-08 15:37:47 [debug    ] Received message from task runner 
[supervisor] msg=TriggerDagRun(logical_date=datetime.datetime(2026, 4, 8, 5, 
37, 47, 502552, tzinfo=Timezone('UTC')), conf={'msg': 'hello'}, 
reset_dag_run=False, dag_id='other_dag', 
run_id='manual__2026-04-08T05:37:47.502552+00:00', type='TriggerDagRun')
   [2026-04-08T15:37:47.507+1000] {_client.py:1025} INFO - HTTP Request: POST 
http://in-process.invalid./dag-runs/other_dag/manual__2026-04-08T05:37:47.502552+00:00
 "HTTP/1.1 404 Not Found"
   2026-04-08 15:37:47 [warning  ] Server error                   
[airflow.sdk.api.client] detail={'detail': {'reason': 'not_found', 'message': 
"DAG with dag_id: 'other_dag' not found"}}
   ```
   
   
[airflow-trigger-dag.logs.txt](https://github.com/user-attachments/files/26559972/airflow-trigger-dag.logs.txt)
   
   
   ### What you think should happen instead?
   
   I would expect the DAG `other_dag` to execute when running `dag.test()`.
   
   ### Operating System
   
   macOS
   
   ### Deployment
   
   None
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Official Helm Chart version
   
   Not Applicable
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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