Build Failure but all tests passing

All of our tests are passing, with no errors - but we are still getting a semi-intermittent build failiure on circleci that we can’t reproduce locally. What are the best ways to debug this/

Build failure is determined by exit code.

0 = pass
anything else = failure

Some frameworks have a distinction between a “failure” and an “error” so that might have something to do with it. Could you tell us more about your stack, tests, etc?