Vamsi-klu opened a new pull request, #62306:
URL: https://github.com/apache/airflow/pull/62306

   ## Problem
   
   `DbtCloudRunJobTrigger.run()` has two bugs that surface when a dbt Cloud job 
run exceeds the configured timeout (#61979):
   
   1. **Misleading error message**: The timeout error message prints the raw 
Unix epoch timestamp (`self.end_time`) instead of a meaningful value, producing 
nonsensical messages like `"Job run 70403194297680 has not reached a terminal 
status after 1771200015.8 seconds."` (≈ 56 years).
   
   2. **Missing final status check**: When the timeout fires, the trigger 
immediately yields an error without re-checking whether the job has since 
completed. If a job finishes between the last poll and the timeout boundary, 
Airflow incorrectly reports a timeout failure even though the dbt Cloud job 
succeeded.
   
   ## Solution
   
   - **Bug 1**: Changed the error message from `f"after {self.end_time} 
seconds."` to `f"within the configured timeout."` since `self.end_time` is an 
absolute epoch timestamp, not a relative duration.
   
   - **Bug 2**: Added a final `is_still_running()` check before yielding the 
timeout error. If the job completed in the interim, the trigger breaks out of 
the while loop and falls through to the normal terminal status handling 
(success/cancelled/error).
   
   ## Testing Done
   
   - Updated existing `test_dbt_job_run_timeout` to verify the corrected error 
message format.
   - Added new `test_dbt_job_run_timeout_with_final_status_check` test that 
simulates a job completing at the timeout boundary — verifies the trigger 
yields success instead of a false timeout error.
   - All 11 tests in 
`providers/dbt/cloud/tests/unit/dbt/cloud/triggers/test_dbt.py` pass.
   - Ruff lint and format checks pass.
   
   ## Breaking Changes
   
   None. The only user-visible change is the timeout error message text, which 
previously contained an incorrect value (epoch timestamp) and now says "within 
the configured timeout." instead.
   
   Closes: #61979
   
   🤖 Generated with [Claude Code](https://claude.ai/code)


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