# Ignore Failed Tests Policy

The **Ignore Failed Tests** capability is a specialized filter used during the test recommendation process to reduce noise and focus on new code changes. It prevents the system from repeatedly recommending tests that are already known to be failing if the underlying code remains unchanged.

### Why It Is Useful

In a fast-moving CI/CD environment, some tests may fail due to known bugs or environment issues that are not being addressed in the current sprint. Repeatedly running these failing tests wastes resources and can obscure new regressions. This logic allows teams to temporarily bypass these "noisy" failures during the optimization phase.

### Detailed Functionality

* **API-Driven Logic:** This capability is not a static dashboard setting. It is triggered via the **Test Optimization API** when requesting test recommendations.
* **Change-Based Validation:** The logic checks two conditions:
  1. Did this test fail in the previous run?
  2. Has the code covered by this test changed since that failure?
* **Exclusion Rules:** If the test failed previously and the associated code has **not** changed, the test is excluded from the current recommendation list. If the code *has* changed, the test will be recommended regardless of its previous status to verify the fix.

### Implementation

When asking for test recommendations through the API, users can toggle this filter. If a test failed in a previous run but the code it covers has not been modified in the current build, the API will exclude it from the recommended list.

***

### FAQ

<details>

<summary><strong>Does this mean I will never see these failures again?</strong> </summary>

No. The tests are only skipped by the optimization engine for that specific run. You can still view the original failures in the SeaLights dashboard.

</details>

<details>

<summary><strong>Is this the same as "Quarantining" a test?</strong></summary>

Not exactly. Quarantining usually hides a test entirely. This logic is smarter because it will automatically "un-hide" and recommend the test as soon as someone modifies the code it covers.

</details>


---

# 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.sealights.io/knowledgebase/test-optimization/test-optimization-strategy/test-selection-policies/ignore-failed-tests-policy.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.
