Documentation Index
Fetch the complete documentation index at: https://trunk-4cab4936-sam-gutentag-flaky-tests-new-monitors.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.

What does “Quarantined” mean?
A quarantined test continues running in CI and uploading results to Trunk Flaky Tests, but its failures won’t block your pipeline. The Trunk Analytics CLI checks with Trunk’s backend to determine if failed tests are quarantined, then overrides the exit code for those failures. When all failures in a CI job come from quarantined tests, the entire job passes. Why this matters: You maintain complete test coverage and historical data while preventing known problematic tests from disrupting your development cycle.How tests get quarantined
Tests can be quarantined through two methods:- Manual Quarantine - You explicitly select specific tests using override settings
- Auto-Quarantine (when enabled) - Tests already flagged by Trunk’s flaky detection are automatically quarantined
Enable quarantining
With quarantining enabled, the Analytics Uploader will compare failed test cases against known flaky tests. If a test is known to be flaky, it will be quarantined. If all failed tests are quarantined, the exit code of the test command will be overridden to return 0 and the CI job will pass.Quarantining settings
To enable quarantining, navigate to Settings > Repositories > repository > Flaky Tests > toggle on Enable Test Quarantining.
| Setting | Description |
|---|---|
| Enable Test Quarantining | This primary toggle activates the quarantining feature set, unlocking both manual override options and the ability to enable auto-quarantining. For any quarantining to work, the necessary configurations must also be made in your CI pipeline. |
| Auto-Quarantine Flaky Tests | When enabled, any test already identified by Trunk as “flaky” will be automatically quarantined. This saves you from having to manually quarantine each flaky test as it’s discovered. |
Collection-level quarantining settings
Test Collections have their own quarantining settings that override the repository-level settings for any uploads routed to that collection. This lets you apply different quarantining policies to different subsets of your test suite. To configure collection quarantining, navigate to Flaky Tests > Collections > collection name > Settings > Quarantining. The same two toggles are available at the collection level:| Setting | Description |
|---|---|
| Enable Test Quarantining | Activates quarantining for this collection. When enabled, this setting overrides the repository-level quarantining setting for uploads that belong to this collection. |
| Auto-Quarantine Flaky Tests | Automatically quarantines any test in this collection that Trunk has identified as flaky. This option is only available when quarantining is enabled for the collection. |
Only organization admins can change collection quarantining settings. Members can view the settings page but cannot toggle the controls.
Quarantining with Sharded or Parallelized Tests
There are two options for handling quarantining. Option 1: Wrapping each test invocation Wrap each command and specify its JUnit output path. Trunk captures the exit code and automatically uploads results. Example0 or 1 based on the outcomes.
Advanced: Handling build errors outside test runs
To handle build issues that occur outside test runs, use the —test-process-exit-code option. This provides a fallback exit code if the upload runs without detecting any Junit results.
Example
- Upload results for each test execution separately, or
- Generate a JUnit that records build errors.
Updates in CI
If you’re using the provided GitHub Actions workflow to upload test results to Flaky Tests, you can quarantine flaky tests by wrapping the test command or as a follow-up step. If you’re using the Trunk Analytics CLI directly or other CI providers, check the instructions in the Using The Trunk Analytics CLI Directly tab.- GitHub Actions Workflow
- Using The Trunk Analytics CLI Directly
Using the Trunk Analytics Uploader Action in your GitHub Actions Workflow files, may need modifications to your workflow files to support quarantining.If you upload your test results as a second step after you run your tests, you need to add If you want to run the test command and upload in a single step, the test command must be run via the Analytics Uploader through the
continue-on-error: true on your test step so your CI job will continue even on failures.Here’s an example file.run: <COMMAND TO RUN TESTS> parameter.This will override the response code of the test command. Make sure to set continue-on-error: false so un-quarantined tests are blocking.Overriding individual tests
If you have tests that should never be quarantined or should always be quarantined regardless of their current health status, you can do this by overriding individual tests.
- Quarantine test / Unquarantine test — toggles the always-quarantine override for that test.
- Never Quarantine test / Remove Never Quarantine — toggles the never-quarantine override. When set, the test is never quarantined, even if auto-quarantining is enabled for the repo.
- To set an override: Click the Quarantine (or Override) button, then select either Always Quarantine or Never Quarantine.
- To remove an override: Click the Remove Override button.
| Setting | Behavior |
|---|---|
| Always Quarantine | Quarantine a test failure even if the health status is healthy. |
| Never Quarantine | Never quarantine failures, even if the health status is flaky, and auto-quarantining is enabled for the repo. |

Tracking quarantined jobs in the dashboard
Once quarantining is active, the Quarantining tab provides a central hub for monitoring its impact and effectiveness. This tab serves as a complete audit log of every CI job saved by the feature, allowing you to:- Visualize Trends: A 30-day chart shows the number of jobs quarantined per day.
- Inspect Individual Jobs: A detailed table lists every quarantined job. Click any entry to see the specific tests that were quarantined.
- Isolate Critical Workflows: Use the filter to see how quarantining impacts specific branches, such as preventing flaky failures in your Merge Queue.
- Measure ROI: Use the data to quantify the number of builds saved and developer time reclaimed for your organization.

Audit logs
Trunk provides audit logs for all setting changes and overwrites for individual tests. You can access the audit log by navigating to Settings > Repositories > repository > Flaky Tests > Audit logs under the Enable Test Quarantining heading.
Quarantining API and webhooks
For advanced use cases, you can interact with quarantining features programmatically.- API: Use the Flaky Tests API to fetch a list of all currently quarantined tests in your project.
- Webhooks: Subscribe to the
test_case.quarantining_setting_changedevent to trigger automated workflows whenever a test’s quarantine override is modified. Learn more about Webhooks.