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.
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
- Open the Tests tab to see exactly which cases failed and their messages.
- Reproduce the failure locally with the same inputs.
- 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.