-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running airflow dags test <dag_id> <execution_dt> results in error when run twice. #21023
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Thank you, @chenglongyan , for such a quick turnaround on this fix! And thank you @potiuk for approving it! |
In my case, the same problem occurs when |
Yeah. I already cherry-picked it to 2.2.4 whcih is ~ few weeks away. |
Apache Airflow version
main (development)
What happened
Product and Version
Airflow Version: v2.3.0.dev0 (Git Version: .release:2.3.0.dev0+7a9ab1d7170567b1d53938b2f7345dae2026c6ea) to test and learn its functionalities. I am currently installed this using git clone and building the airflow on my MacOS environment, using python3.9.
Problem Statement
When I was doing a test on my DAG, I wanted run
airflow dags test <dag_id> <execution_dt>
so that I don't have to use UI to trigger dag runs each time. Running and looking at the result of the dags test proved to be more productive when doing some rapid tests on your DAG.The test runs perfectly for the first time it runs, but when I try to re-run the test again the following error message is observed:
When going through the DAG runs in my UI, I noticed the following entry on my dag test run.
Looks like when you run the dag with
test
mode, it submits the dag run asbackfill
type. I am not completely sure why theairflow dags test
would only succeed once, but looks like there might have been some process that may be missing to clear out the test (just my theory).Workaround
A viable workaround to stop it from failing is to find and
deleting
the dag run instance. Once the above dag run entry is deleted, I could successfully run myairflow dags test
command again.What you expected to happen
According to the documentation (https://airflow.apache.org/docs/apache-airflow/stable/tutorial.html#id2), it is stated that:
It does not mention about whether you have to delete the dag run instance to re-run the test, so I would expect that
airflow dags test
command will run successfully, and also successfully on any consecutive runs without any errors.How to reproduce
airflow standalone
command. It should start up the basic webserver, scheduler, triggerer to start testing it.airflow dags test <dag_id> <start_dt>
to initiate DAGs test.Operating System
MacOS Monterey (Version 12.1)
Versions of Apache Airflow Providers
No providers were used
Deployment
Other
Deployment details
This airflow is running as a
standalone
on my local MacOS environment. I have setup a dev env, by cloning from the github and built the airflow to run locally. It is using sqlite as its backend database, and sequentialExecutor to execute tasks sequentially.Anything else
Nothing much. I would like this issue to be resolved so that I could run my DAG tests easily without 'actually' running it or relying on the UI. Also, there seems to be little information on what this
test
means and what it is different from the normal runs, so improving documentation to clarify it would be nice.Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: