Is there a way to terminate CI if the jobs end up running too long? I’m having an issue where on occasion our 5-minute tests will end up taking up to an hour. I’d love to terminate it instead of wasting precious CPU cycles.
Yep, just use the timeout shell command prior to your potentially long-running command.
(So for me, I’d do something like timeout 5m phpunit --stop-on-fail --stop-on-error).
If you have a process that is tracking how long the step is running you can either cancel it via API if it’s external, or circleci halt if it’s internal.
Can you look at the history of that container to get any clues as to why it took so long?

