Skip to content

Add task sdk integration tests for ti rtif, heartbeat, state transitions#57198

Merged
amoghrajesh merged 1 commit intoapache:mainfrom
astronomer:extend-integration-tests-ti
Oct 25, 2025
Merged

Add task sdk integration tests for ti rtif, heartbeat, state transitions#57198
amoghrajesh merged 1 commit intoapache:mainfrom
astronomer:extend-integration-tests-ti

Conversation

@amoghrajesh
Copy link
Contributor

Next part to: #57056

Expanding the tests to cover more breadth in the task instance space itself.

The tests now added cover these:

  1. test_ti_set_rtif

    • Sets Rendered Task Instance Fields
    • Tests the endpoint: PUT /task-instances/{id}/rtif
  2. test_ti_heartbeat

    • Sends heartbeat for a running task instance
    • Tests the endpoint: PUT /task-instances/{id}/heartbeat
    • Special Implementation: Fetches actual worker PID/hostname from Core API, then patches get_hostname() to match, ensuring heartbeat validation succeeds
    • Validates PID/hostname matching logic
  3. 7test_ti_state_transitions

    • Tests state transition to terminal state (FAILED)
    • Tests the endpoint: PATCH /task-instances/{id}/state
    • Validates the finish() method
    • Will expand this further to cover deferred as well as up_for_retry

What's Next

Following the testing roadmap, the next priorities are:

  1. XCom operations tests
  2. Variable operations tests
  3. Connection operations tests
  4. DAG Run operations tests
  5. Asset operations tests

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@amoghrajesh amoghrajesh self-assigned this Oct 24, 2025
@amoghrajesh amoghrajesh requested review from phanikumv and vatsrahul1001 and removed request for ashb October 24, 2025 13:42
@amoghrajesh amoghrajesh changed the title Add task instance integration tests for rtif, heartbeat, state transitions Add task sdk integration tests for ti rtif, heartbeat, state transitions Oct 24, 2025
Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

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

Nice! LGMT overall!

@amoghrajesh amoghrajesh added this to the Airflow 3.2.0 milestone Oct 25, 2025
@amoghrajesh amoghrajesh merged commit cf991d8 into apache:main Oct 25, 2025
50 checks passed
@amoghrajesh amoghrajesh deleted the extend-integration-tests-ti branch October 25, 2025 06:26
@potiuk
Copy link
Member

potiuk commented Oct 25, 2025

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants