Repository navigation
Add a timeout to CI builds #103180
Description
Activity
- addedbuildThe build process and cross-buildThe build process and cross-build
on Apr 2, 2023 I would like to publicly apologize for the PR. It didn't turn out the way I had intended.
Reacted by Alex WaygoodNo apology necessary, it's better that we find out about this problem through a well-intentioned joke.
I was actually surprised when I saw the PR that it showed you as a first-time contributor here. Based on the level of your contributions on the Python Discord, I'm sure there's lots of useful work you could do on CPython if you are so inclined. Perhaps your next PR will be less quadratic. (And if you're not interested or don't have time, that's perfectly fine too, of course.)
Related issue (for the build step only): gh-90361.
I had some time to look at this. I think that we need to base timeouts:
- For short actions, like
staleandlabels - For build / test actions
Short timeout
staletakes ~1m average to finish:

new-bugs-notifiertakes several seconds:

check-labelsalso takes several seconds:

verify-ensurepip-wheelstakes several seconds:

project-updatertakes several seconds as well:

I think that 10 minutes as a timeout is a reasonable number for this group.
It will allow quite some performance degradation, but still keep our resources under controll.Slow actions
docscan work from 10m up to 20m:

testsmsican take from several minutes up to 20m:

So, using 1h is a resonable timeout.
I will send a PR with these timeouts in a moment.
Plus, I will change per-step timeouts from #90361 to be job-level (and increase them).Reacted by sunmy2019 and Kyle Hofmann- For short actions, like
- added a commit that references this issue
on Apr 11, 2023 - added a commit that references this issue
on Apr 14, 2023 - added a commit that references this issue
on Apr 14, 2023 Looks like this was completed, thanks all!
- added 4 commits that reference this issue
on Feb 22, 2025

The joke PR #103178 included some very slow code that runs at import time, and CI took >3 hours before I canceled it. This wastes resources and is a possible abuse vector; a malicious actor could use it to eat up our CI resource quota. We should have some reasonable timeout (1 hour?) for all CI builds.
Linked PRs