apache / apache/airflow

The `test_refresh_dags_dir_deactivates_deleted_zipped_dags` is flaky

Open
#46,432 1 comment 0 reactions 0 assignees View on GitHub
area:CI area:core
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 10h
Merged PRs (30d)
483

Description

Flaky test in DAG zipped dags

```python
=================================== FAILURES ===================================
_ TestDagFileProcessorManager.test_refresh_dags_dir_deactivates_deleted_zipped_dags _
tests/dag_processing/test_manager.py:636: in test_refresh_dags_dir_deactivates_deleted_zipped_dags
assert not dag.get_is_active()
E assert not True
E + where True = get_is_active()
E + where get_is_active = .get_is_active
----------------------------- Captured stdout call -----------------------------
[2025-02-04T16:02:01.361+0000] {dagbag.py:574} INFO - Filling up the DagBag from /tmp/pytest-of-root/pytest-0/test_refresh_dags_dir_deactiva0
[2025-02-04T16:02:01.364+0000] {dagbag.py:442} INFO - File /opt/airflow/tests/dags/test_zip.zip:file_no_airflow_dag.py assumed to contain no DAGs. Skipping.
[2025-02-04T16:02:01.371+0000] {collection.py:83} INFO - Creating ORM DAG for test_zip_dag
[2025-02-04T16:02:01.391+0000] {manager.py:231} INFO - Processing files using up to 2 processes at a time
[2025-02-04T16:02:01.391+0000] {manager.py:232} INFO - Process each file at most once every 30 seconds
[2025-02-04T16:02:01.392+0000] {manager.py:98} INFO - DAG bundles loaded: testing
[2025-02-04T16:02:01.394+0000] {manager.py:98} INFO - DAG bundles loaded: testing
[2025-02-04T16:02:01.395+0000] {manager.py:443} INFO - Refreshing DAG bundles
[2025-02-04T16:02:01.398+0000] {manager.py:531} INFO - Searching for files in testing at /opt/airflow/tests/dags
[2025-02-04T16:02:01.416+0000] {manager.py:533} INFO - Found 41 files for bundle testing
[2025-02-04T16:02:01.466+0000] {manager.py:704} INFO -
================================================================================
```

Example failure: https://github.com/apache/airflow/actions/runs/13139235278/job/36662824378?pr=46431#step:6:3443

Contributor guide

Open the contributing guide

Research direction

Start with tests/dag_processing/test_manager.py:636 and reproduce test_refresh_dags_dir_deactivates_deleted_zipped_dags repeatedly. Trace the related DAG refresh and deactivation messages in the captured dagbag.py and manager.py output, then confirm the test passes reliably after the flaky behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.