Skip to content

Construct task instances with ExecuteTask.make for celery executor integration tests#61311

Merged
amoghrajesh merged 4 commits into
apache:mainfrom
Prab-27:up-checks-main
Feb 2, 2026
Merged

Construct task instances with ExecuteTask.make for celery executor integration tests#61311
amoghrajesh merged 4 commits into
apache:mainfrom
Prab-27:up-checks-main

Conversation

@Prab-27

@Prab-27 Prab-27 commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

This PR adds the required fields using make() classmethod to the Pydantic ExecuteTask class to ensure proper validation


Was generative AI tooling used to co-author this PR?

<

If generative AI tooling has been used in the process of authoring this PR, please
change below checkbox to [X] followed by the name of the tool, uncomment the "Generated-by".
-->

  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@Prab-27

Prab-27 commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

Could you please check whether we need this PR, or if the tests are already resolved?

@henry3260

Copy link
Copy Markdown
Contributor

I think the current PR title might be confusing. Maybe we can update it to focus on the flaky test test_celery_integration.

@bugraoz93 bugraoz93 changed the title [main] Upgrade important CI environment Add params to model_construct for flaky clery test Feb 1, 2026
@bugraoz93

Copy link
Copy Markdown
Contributor

We generally use that title for upgrading dependencies from prek, uv on our CI. This looks like indeed related to flaky test since we haven't seen a couple and popped up again
https://github.com/apache/airflow/actions/runs/21563876024

@Prab-27

Prab-27 commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

I misunderstood the rule about updating the PR title. I thought it meant this, but I see now that’s not right.

@bugraoz93 bugraoz93 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though it is in celery, what it generates as model is purely related to TaskSDK and Execution API communication, so I would also like to take @amoghrajesh on this one

@Prab-27, In the short term, as a CI team, we can increase flakiness from 3 to 5 and add a delay between runs with a delay parameter, so we can be more flexible until we have the solution. Please let me know if you can update, or I can also do it

Comment thread providers/celery/tests/integration/celery/test_celery_executor.py Outdated
@bugraoz93 bugraoz93 requested a review from amoghrajesh February 1, 2026 16:12
@Prab-27

Prab-27 commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

@bugraoz93 Okay I'm trying to update it and get back to you

@bugraoz93

Copy link
Copy Markdown
Contributor

I think your other PR should give us some more time until we are bothered more :) No rush, just wanted to clarify here too

@Prab-27

Prab-27 commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

Another tests are failing , I'm updating Taskinstance class

Edited : It's wrong thoughts

@Prab-27

Prab-27 commented Feb 1, 2026

Copy link
Copy Markdown
Contributor Author

Oops !! Tests are failing due to

ser_ti.parent_context_carrier = ti.dag_run.context_carrier
in make() classmethod

Error Log :

 providers/celery/tests/integration/celery/test_celery_executor.py:202: in test_celery_integration
    workloads.ExecuteTask.make(
airflow-core/src/airflow/executors/workloads.py:131: in make
    ser_ti.parent_context_carrier = ti.dag_run.context_carrier
/usr/python/lib/python3.10/site-packages/pydantic/main.py:1026: in __getattr__
    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
E   AttributeError: 'TaskInstance' object has no attribute 'dag_run'

@bugraoz93 Does this fine to use model_construct ? OR any other idea ?

@amoghrajesh amoghrajesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you follow pattern similar to test_base_executor to fix the CI on this PR: https://github.com/apache/airflow/blob/main/airflow-core/tests/unit/executors/test_base_executor.py#L226-L239

Comment thread providers/celery/tests/integration/celery/test_celery_executor.py
@Prab-27

Prab-27 commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

Let's see !

I don't understand this - strange behavior.
Why does restart sometimes work and sometimes fail?
If it passes once, then it always passes. If it fails once, then it always fails.

@henry3260

Copy link
Copy Markdown
Contributor

Let's see !

I don't understand this - strange behavior.

Why does restart sometimes work and sometimes fail?

If it passes once, then it always passes. If it fails once, then it always fails.

Not always — sometimes concurrency issues, network instability, or infrastructure hiccups can cause the test to be flaky.

@Prab-27 Prab-27 changed the title Add params to model_construct for flaky clery test Add params for flaky celery test Feb 2, 2026

@amoghrajesh amoghrajesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, preemptive approval assuming nits are handled.

Comment thread providers/celery/tests/integration/celery/test_celery_executor.py Outdated

@bugraoz93 bugraoz93 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks @Prab-27 !

@amoghrajesh amoghrajesh merged commit 784e1a9 into apache:main Feb 2, 2026
86 checks passed
@amoghrajesh amoghrajesh changed the title Add params for flaky celery test Construct task instances with ExecuteTask.make for celery executor integration tests Feb 2, 2026
@amoghrajesh amoghrajesh changed the title Construct task instances with ExecuteTask.make for celery executor integration tests Construct task instances with ExecuteTask.make for celery executor integration tests Feb 2, 2026
jason810496 pushed a commit to abhijeets25012-tech/airflow that referenced this pull request Feb 3, 2026
Alok-kumar-priyadarshi pushed a commit to Alok-kumar-priyadarshi/airflow that referenced this pull request Feb 5, 2026
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
Ratasa143 pushed a commit to Ratasa143/airflow that referenced this pull request Feb 15, 2026
choo121600 pushed a commit to choo121600/airflow that referenced this pull request Feb 22, 2026
Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Mar 4, 2026
Ankurdeewan pushed a commit to Ankurdeewan/airflow that referenced this pull request Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants