# Fail-Fast

In Fail-Fast mode, Redefine optimizes your CI builds by selectively running tests related to the code changes, similar to Optimize mode. These tests are executed until the specified [Configuration Parameters](/configuration/configuration-parameters.md#confidence) is reached. If the confidence level is not configured, Redefine will use the default level. If none of these tests fail within the given confidence level, the CI build proceeds to run the entire test suite to ensure full coverage. However, if any of the tests fail before reaching the confidence level, the build is halted immediately, providing early feedback on the introduced code changes.

\
This approach is suitable for those who cannot overlook even the slightest chance of missing a failed test. This leads to quicker feedback time on test failures with better resource utilization on failed CI builds. However, compared to Optimize Mode, resource utilization may not be as optimal.

```bash
redefine install --fail-fast --<testing_framework>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redefine.dev/configuration/selection-modes/fail-fast.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
