Skip to content
Latchkey

Bamboo "Broken build" with test failures in CI

Bamboo parsed the test results the task produced, found one or more failing tests, and marked the build "Broken" with the failure count. The failing tests, not the infrastructure, are the cause.

What this error means

The build summary reads "Broken build" or "N test failures" and lists the failing test cases in the Tests tab.

Bamboo
Broken build: 3 of 214 tests failed.
com.example.LoginTest.testInvalidPassword: expected <401> but was <500>

Common causes

Real test failures in the code under test

The tests ran and asserted failures, so the change (or a dependency) broke behavior the tests check.

Environment-only failures in CI

Tests pass locally but fail on the agent due to missing services, timezone, or data differences, still reported as broken.

How to fix it

Open the failing tests and fix the assertions

  1. Open the Tests tab to see exactly which cases failed and their messages.
  2. Reproduce the failure locally with the same inputs.
  3. Fix the code or the test, then re-run to confirm the build is green.

Align the CI environment for environment-only failures

If tests only fail on the agent, provide the services, data, or configuration they need so the agent matches local runs.

How to prevent it

  • Run the full test suite locally before pushing.
  • Keep CI test environment parity (services, timezone, seed data).
  • Address flaky tests instead of masking them with quarantine.

Frequently asked questions

What causes ""Broken build ... test failures""?
The tests ran and asserted failures, so the change (or a dependency) broke behavior the tests check.
How do I fix "Broken build ... test failures"?
Open the failing tests and fix the assertions

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card