Skip to content

Make the CI unit test timeout fire before the job timeout does - #72259

Merged
potiuk merged 2 commits into
apache:mainfrom
rjgoyln:fix/ci-total-test-timeout-job-budget
Aug 30, 2026
Merged

Make the CI unit test timeout fire before the job timeout does#72259
potiuk merged 2 commits into
apache:mainfrom
rjgoyln:fix/ci-total-test-timeout-job-budget

Conversation

@rjgoyln

@rjgoyln rjgoyln commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

The parallel test timeout exists so that a hanging test group is stopped while the job can still dump the container logs and upload them as artifacts. It has never managed that: the alarm is armed in the job's last step, while the 65 minute budget starts at the first. Restoring the CI image takes six to eight minutes and the migration tests another four to nineteen, so a fixed 60 minute test timeout could only fire in a job GitHub had already cancelled — every hang surfaced as a bare job timeout, with no logs and no sign of which test group was stuck.

Deriving the timeout from what is left of the budget, rather than raising the budget, restores the guarantee additional-ci-image-checks.yml gets from breeze shell --max-time; that one holds only because nothing of variable length runs before it.

timeout-minutes becomes a workflow_call input that no caller has to pass: job-level timeout-minutes cannot read env, so an input is the only way for it and the tests to share one number instead of two that can drift.

Tests

On this PR's own run the unit test jobs were given between 2707s and 3271s, depending on how much the image restore and the migration tests had already spent — every one of them under the 3600s the timeout was previously pinned at.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

@rjgoyln rjgoyln changed the title CI: Make the unit test timeout fire before the job timeout does Make the CI unit test timeout fire before the job timeout does Aug 29, 2026
@rjgoyln
rjgoyln force-pushed the fix/ci-total-test-timeout-job-budget branch from c1a7c44 to 5242a0a Compare August 29, 2026 17:29
@potiuk

potiuk commented Aug 29, 2026

Copy link
Copy Markdown
Member

Nice idea

The test timeout exists so that a hanging test group is stopped while the job
still has time to dump the container logs and upload them as artifacts. It
never got that chance. The alarm is armed in the last step of the job, but the
job budget starts at the first one, and checking out the repo, pulling the CI
image and running the migration tests routinely take twenty minutes or more
before any test runs. A fixed sixty minute test timeout could therefore only
fire in a job GitHub had already cancelled, so every hang surfaced as a bare
job timeout with no logs to explain it.
@rjgoyln
rjgoyln force-pushed the fix/ci-total-test-timeout-job-budget branch from 5242a0a to 4a83dd9 Compare August 30, 2026 05:48
@rjgoyln
rjgoyln marked this pull request as ready for review August 30, 2026 06:39
Comment thread scripts/ci/testing/run_unit_tests.sh Outdated

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved with NIT

The line reported the budget left in seconds next to a job timeout in minutes,
so anyone reading it had to convert one to compare them.
@potiuk
potiuk merged commit 14397bc into apache:main Aug 30, 2026
117 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 14397bc v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

potiuk added a commit that referenced this pull request Aug 30, 2026
… does (#72259) (#72299)

* Make the CI unit test timeout fire before the job timeout does

The test timeout exists so that a hanging test group is stopped while the job
still has time to dump the container logs and upload them as artifacts. It
never got that chance. The alarm is armed in the last step of the job, but the
job budget starts at the first one, and checking out the repo, pulling the CI
image and running the migration tests routinely take twenty minutes or more
before any test runs. A fixed sixty minute test timeout could therefore only
fire in a job GitHub had already cancelled, so every hang surfaced as a bare
job timeout with no logs to explain it.

* Print the CI test budget in minutes and seconds

The line reported the budget left in seconds next to a job timeout in minutes,
so anyone reading it had to convert one to compare them.
(cherry picked from commit 14397bc)

Co-authored-by: rjgoyln <151457491+rjgoyln@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants