Skip to content

CI: Add 60-minute timeouts to GitHub Actions and Cirrus CI #15589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

Ayesh
Copy link
Member

@Ayesh Ayesh commented Aug 26, 2024

Currently, there are no explicit timeouts set for CI jobs, which means the CI jobs will keep running until they are terminated by the task runner. The current defaults of each provider are:

  • GitHub Actions: 360 minutes1
  • Cirrus CI: 60 minutes2
  • Travis CI: 50 minutes3

On Travis, the timeout is not configurable, and given that our test suite usually completes within 20 minutes, this commit explicitly sets timeouts for Cirrus CI and GitHub Actions to 50 minutes as well.

Footnotes

  1. GitHub Actions Workflow Syntax

  2. Cirrus CI FAQ

  3. Travis docs - customizing the build

@Ayesh
Copy link
Member Author

Ayesh commented Aug 26, 2024

This is motivated from CO2 emission guilt because I accidentally caused a test to hang forever and CI kept on going only until GitHub Actions killed it after full six hours. I didn't have permissions to cancel the build either (unless I force-push, which starts another run anyway).

@iluuu1994
Copy link
Member

Rare occurrence, but I don't object to setting these. Most of these jobs are also executed in nightly. That said, some of them get pretty close to 50 minutes, either randomly or due to parallel load. https://github.com/php/php-src/actions/runs/10588551653/job/29341333738

@Ayesh
Copy link
Member Author

Ayesh commented Aug 29, 2024

@iluuu1994 thank you! You are right, I think 50 minutes is probably not within a reasonable tolerance. How about 60 minutes?

gh run list --limit 500 --workflow push.yml

I took a look at all runs that took longer than 60 minutes. Some of the items seem to be wrong measurements, with gh reporting values like 2 hours but individual tasks still took 30-40 minutes. Some did in fact took more than 2 hours, but they eventually failed mostly on Windows due to some exe files being seemingly broken.

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

That said, some of them get pretty close to 50 minutes, either randomly or due to parallel load. https://github.com/php/php-src/actions/runs/10588551653/job/29341333738

42 minutes is still well below 50 minutes (~15% below). I don't particularly care about the specific number and agree that this change makes sense in general.

Currently, there are no explicit timeouts set for CI jobs, which means
the CI jobs will keep running until they are terminated by the task
runner. The current defaults of each provider are:

 - GitHub Actions: 360 minutes[^1]
 - Cirrus CI: 60 minutes[^2]
 - Travis CI: 50 minutes[^3]

On Travis, the timeout is not configurable, and given that our test suite
usually completes within 20 minutes, this commit explicitly sets
timeouts for Cirrus CI and GitHub Actions to 50 minutes as well.

[^1]: [GitHub Actions Workflow Syntax](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes)
[^2]: [Cirrus CI FAQ](https://cirrus-ci.org/faq/#instance-timed-out)
[^3]: [Travis docs - customizing the build](https://docs.travis-ci.com/user/customizing-the-build#build-timeouts)
@cmb69
Copy link
Member

cmb69 commented Sep 25, 2024

I think this is good to go. If there are issues, we can still increase the timeouts.

Thank you, @Ayesh!

@cmb69 cmb69 merged commit 3566421 into php:master Sep 25, 2024
10 checks passed
@Ayesh
Copy link
Member Author

Ayesh commented Sep 25, 2024

yay, thank you!

@Ayesh Ayesh deleted the ci-timeout branch September 25, 2024 10:58
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.

4 participants