We built a tool for custom timeouts on your Unity Cloud builds

A current limitation of Unity’s Build Automation platform is that they don't allow any customisation of your cloud build timeouts via their web interface.

So, if a build unexpectedly stalls without "failing", unless you happen to notice and manually cancel it, you can wind up with it running for many hours unnecessarily, burning your build minutes, and costing you money.

While most build errors will cause Unity to hard fail the build, and end the run, in our experience many times - it also just doesn't.

We really love the simplicity of Unity's cloud platform for allowing game teams to get an automated build pipeline up and running quickly, but this has long been one of my personal frustrations with it.

An expensive stalled Unity cloud build

Here's an example run of one of my own projects on Unity Build Automation. As you can see, the build was never actually assigned to a runner, never checked out, and so has no log. Yet while the build never started, Unity let it continue in a billable state for 15,953 minutes (over 11 days!) before I thankfully happened to spot it, and manually cancelled.

This single stalled build resulted in a bill from Unity for £286.

Now again, we're big fans of Unity's platform, and in that instance their support team couldn't have been more helpful in clearing the bill. They should also at least have a default build timeout of 24 hours (when it works..).

However, it got us thinking that it would be nice to be able to configure a reliable timeout on each of our build configurations, tweak it really easily, and not have to stress about keeping a close eye on our running builds.

Easily adjust timeouts via the Buildstash web UI

To help with this, we built a tool inside Buildstash to let you configure automated forced timeouts of Unity builds if they’ve either been queued for a set time, but not started, or been “building” for way longer than would be normal.

You can configure two settings:

  • "Timeout if queued after" will tell Unity to cancel the build if it's queued but doesn't reach a "started" state within this time limit.
  • "Timeout build after" starts when Unity tells us the build actually started running, and won't stop until it reaches a terminal state ('success', 'failure', etc).

These are all customisable per-Unity build target. So for example, you may know that your iOS build should never take longer than an hour. But maybe your Android builds you want to cap at 2 hours. This provides that flexibility.

Full transparency over timeout events via your pipeline log in Buildstash

When a build times out, Buildstash will instruct Unity to cancel it via API request.

Though note - while this should reliably cancel the build (providing the Unity API key you provided is correct and webhook events setup correctly - see the docs) this of course ultimately relies on Unity's platform!

Our timeout utility for Unity Build Automation is now available on all plans. Check out the docs to get started.