Cancel builds that go over a certain time limit

For some reason I’ve yet to figure out, my builds occasionally hang. My builds usually take 15-20 minutes to complete, however sometimes they will freeze and eventually end up getting killed after 5 hours with a ‘time limit exceeded’ message.

The simplest work around for me at the moment would be to just lower this 5 hour time limit, but I can’t see an option for it.

Setting a time limit per test I don’t think will help as the freezing seems to occur during the test setup.