---
title: Validate Optimizations
description: >-
  Validate that Test Optimization features—including Early Flake Detection, Auto
  Test Retries, and Flaky Test Management—are working correctly in your
  repository.
breadcrumbs: >-
  Docs > Test Optimization in Datadog > Test Optimization Guides > Validate
  Optimizations
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Validate Optimizations

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

This page explains how to check that the optimizations offered by Test Optimization are working as intended. The guide assumes that [Test Optimization](https://docs.datadoghq.com/tests.md) already works for the repository under validation, and it shows the steps to validate optimizations for a **single repository**.

{% alert level="warning" %}
Run these validations in a feature branch only, and do not merge them into your default or main branch.
{% /alert %}

## Prerequisites{% #prerequisites %}

These optimizations require a [supported native library](https://docs.datadoghq.com/tests.md). JUnit XML uploads are not supported.

## Option 1: Validate locally with a coding agent{% #option-1-validate-locally-with-a-coding-agent %}

{% callout %}
# Important note for users on the following Datadog sites: app.datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, app.datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com

{% callout %}
##### Join the Preview!

Local coding-agent validation is in Preview, and supports only JavaScript and TypeScript projects that use the npm [`dd-trace` package](https://www.npmjs.com/package/dd-trace).
{% /callout %}

{% /callout %}

Using the provided prompt below, ask a local coding agent (an AI assistant that can inspect and run commands in your local repository) to inspect your installed `dd-trace` package and run its Test Optimization validation runbook. This method checks local library compatibility and CI configuration. It also checks Early Flake Detection, Auto Test Retries, and Test Management without changing Datadog settings or sending validation results to Datadog.

The runbook is at `ci/runbook.md` relative to the installed `dd-trace` package root.

Pass this prompt to your local coding agent:

```text
Locate the installed dd-trace package, then read and execute its ci/runbook.md.
```

This coding-agent method is a local check that does not exercise the entire Datadog workflow. To validate the full Prevention, Mitigation, and Remediation workflows, or to validate a language other than JavaScript or TypeScript, use Option 2, below.

## Option 2: Validate the full workflow{% #option-2-validate-the-full-workflow %}

This validation workflow checks the complete Test Optimization workflow in Datadog. Perform these validations (Prevention, Mitigation, and Remediation) in order, as they use the same branch and test.

### Step 1: Set up validation{% #step-1-set-up-validation %}

This guide walks you through making local changes and committing them for CI to run. It uses a dedicated test service and branch to minimize the validation workflow's impact on other developers in the repository.

1. Configure your CI test job to set `DD_SERVICE` before it runs the test command:

   ```bash
   export DD_SERVICE=validate-test-optimization
   ```

1. Create the validation branch:

   ```bash
   git checkout -b validate-test-optimization
   ```

1. Commit the CI configuration change that sets `DD_SERVICE`, then push the validation branch to trigger a test execution:

   ```bash
   git add -A
   git commit -m "Configure Test Optimization validation service"
   git push -u origin validate-test-optimization
   ```

Datadog detects the `validate-test-optimization` service when the tests report under that name.

1. After CI finishes, go to the [CI/CD Repositories settings](https://app.datadoghq.com/ci/settings/ci-cd/repositories?tab=repository) and select the repository you are validating.

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/ci_cd_repositories_settings.741678fe225d7aec76177840721383b0.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/ci_cd_repositories_settings.741678fe225d7aec76177840721383b0.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="CI/CD Repositories settings filtered to the repository being validated" /%}

1. In the upper-right corner of the slide-out panel, click Test Service.

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/repository_settings_test_services.c233526e01b89f59a9022da0c1474f21.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/repository_settings_test_services.c233526e01b89f59a9022da0c1474f21.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="Repository Settings with the Test Service button in the upper-right corner" /%}

1. In Test service overrides, select the `validate-test-optimization` service.

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/test_service_overrides.b90d0596e2c352e79bb12a98dddd1847.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/test_service_overrides.b90d0596e2c352e79bb12a98dddd1847.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="Test service overrides showing detected test services for a repository" /%}

1. Configure the following service overrides:

   - Enable [Early Flake Detection](https://docs.datadoghq.com/tests/flaky_tests/early_flake_detection.md).
   - Enable [Auto Test Retries](https://docs.datadoghq.com/tests/flaky_tests/auto_test_retries.md).
   - Disable [Test Impact Analysis](https://docs.datadoghq.com/tests/test_impact_analysis.md) (so it does not skip the validation test).

1. Return to the repository settings. [Flaky Test Policies](https://docs.datadoghq.com/tests/flaky_management.md#configure-policies-to-automate-the-flaky-test-lifecycle) apply to every test service in the repository, not to an individual test service. To limit the validation policy's impact, configure it only for the `validate-test-optimization` branch. Under Flaky Test Policies, on the Quarantine tile, click Configure.

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/flaky_test_policies_quarantine.b97bba4eb1bda44b8a24c942fae37e86.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/flaky_test_policies_quarantine.b97bba4eb1bda44b8a24c942fae37e86.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="Repository settings showing the Configure button for the Quarantine flaky test policy" /%}

1. Enable the second auto-rule: **If an Active flaky test flakes in the `validate-test-optimization` branch, then move to Quarantined**.

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/quarantine_branch_policy.0afac5231f2e549b198543bdb66548a7.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/quarantine_branch_policy.0afac5231f2e549b198543bdb66548a7.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="Quarantine policy configured for active flaky tests on the validate-test-optimization branch" /%}

1. Click Save.

1. Create a [New Flaky Test PR Gate](https://app.datadoghq.com/ci/pr-gates/rule/create?dataSource=test_optimization) and scope it to the repository you are validating.

{% image
   source="https://docs.dd-static.net/images/pr_gates/setup/pr_gate_scope.2f4414c836045b0d7d292a1187579ea5.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/pr_gate_scope.2f4414c836045b0d7d292a1187579ea5.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="New flaky PR gate scope" /%}

### Step 2: Prevention{% #step-2-prevention %}

[Early Flake Detection](https://docs.datadoghq.com/tests/flaky_tests/early_flake_detection.md) detects new flaky tests. [New Flaky Test PR Gates](https://docs.datadoghq.com/tests/guides/setup_new_flaky_pr_gate.md) block them from reaching your default branch.

1. Add a test that fails on the first attempt and passes on retries (optionally using the code provided below). The test name must contain both `flaky` and `validation` so you can identify it in Datadog.

   {% tab title="JavaScript" %}

   ```javascript
   const fs = require('node:fs');
   const os = require('node:os');
   const path = require('node:path');
   
   test('flaky validation test', () => {
       const marker = path.join(os.tmpdir(), 'dd-validation-flaky');
       if (!fs.existsSync(marker)) {
           fs.writeFileSync(marker, '1');
           throw new Error('first attempt fails so Datadog can retry it');
       }
   });
   ```

   {% /tab %}

   {% tab title="Python" %}

   ```python
   from pathlib import Path
   from tempfile import gettempdir
   
   
   def test_flaky_validation_test():
       marker = Path(gettempdir()) / "dd-validation-flaky"
       if not marker.exists():
           marker.write_text("1")
           raise AssertionError("first attempt fails so Datadog can retry it")
   ```

   {% /tab %}

   {% tab title="Java" %}

   ```java
   import static org.junit.jupiter.api.Assertions.fail;
   
   import java.io.IOException;
   import java.nio.file.Files;
   import java.nio.file.Path;
   import java.nio.file.Paths;
   import org.junit.jupiter.api.Test;
   
   class ValidationFlakyTest {
       @Test
       void flakyValidationTest() throws IOException {
           Path marker = Paths.get(
               System.getProperty("java.io.tmpdir"),
               "dd-validation-flaky"
           );
           if (Files.notExists(marker)) {
               Files.write(marker, new byte[] { '1' });
               fail("first attempt fails so Datadog can retry it");
           }
       }
   }
   ```

   {% /tab %}

   {% tab title="Ruby" %}

   ```ruby
   require 'tmpdir'
   
   RSpec.describe 'validation flaky tests' do
     it 'flaky validation test' do
       marker = File.join(Dir.tmpdir, 'dd-validation-flaky')
       unless File.exist?(marker)
         File.write(marker, '1')
         raise 'first attempt fails so Datadog can retry it'
       end
     end
   end
   ```

   {% /tab %}

   {% tab title=".NET" %}

   ```csharp
   using System.IO;
   using Xunit;
   
   public class ValidationFlakyTests
   {
       [Fact]
       public void FlakyValidationTest()
       {
           var marker = Path.Combine(Path.GetTempPath(), "dd-validation-flaky");
           if (!File.Exists(marker))
           {
               File.WriteAllText(marker, "1");
               throw new System.Exception("first attempt fails so Datadog can retry it");
           }
       }
   }
   ```

   {% /tab %}

   {% tab title="Go" %}

   ```go
   package validation
   
   import (
       "errors"
       "os"
       "path/filepath"
       "testing"
   )
   
   func TestFlakyValidationTest(t *testing.T) {
       marker := filepath.Join(os.TempDir(), "dd-validation-flaky")
       if _, err := os.Stat(marker); errors.Is(err, os.ErrNotExist) {
           if writeErr := os.WriteFile(marker, []byte("1"), 0600); writeErr != nil {
               t.Fatal(writeErr)
           }
           t.Fatal("first attempt fails so Datadog can retry it")
       }
   }
   ```

   {% /tab %}

   {% tab title="Swift" %}

   ```swift
   import XCTest
   
   final class ValidationFlakyTests: XCTestCase {
       func testFlakyValidationTest() throws {
           let marker = FileManager.default.temporaryDirectory
               .appendingPathComponent("dd-validation-flaky")
           if !FileManager.default.fileExists(atPath: marker.path) {
               try "1".write(to: marker, atomically: true, encoding: .utf8)
               XCTFail("first attempt fails so Datadog can retry it")
           }
       }
   }
   ```

   {% /tab %}

1. Commit and push the test, then open a pull request from the validation branch:

   ```bash
   git add -A
   git commit -m "Validate Test Optimization prevention"
   git push origin validate-test-optimization
   ```

1. Wait for CI to run. Early Flake Detection retries the new test, and the New Flaky Test PR Gate evaluates the result. In the GitHub checks for your pull request, confirm that the New Flaky Test PR Gate fails:

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/failed_pr_gate.340f689e06e353559d009c926477ca24.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/failed_pr_gate.340f689e06e353559d009c926477ca24.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="GitHub pull request check failing because a new flaky test is detected" /%}

1. Click the failing GitHub check and confirm that the test is included in the list of new flaky tests:

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/pr_gate_detail.370daebed189f6dbd1e2634aaf31fd09.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/pr_gate_detail.370daebed189f6dbd1e2634aaf31fd09.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="Datadog PR gate detail view" /%}

1. In [Test Runs](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.name%3A%2Aflaky%2Avalidation%2A%20%40git.branch%3Avalidate-test-optimization%20%40test.retry_reason%3Aearly_flake_detection%20%40test.test_management.is_new_flaky%3Atrue), confirm that Early Flake Detection retried the test and detected it as a new flaky test using [this query](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.name%3A%2Aflaky%2Avalidation%2A%20%40git.branch%3Avalidate-test-optimization%20%40test.retry_reason%3Aearly_flake_detection%20%40test.test_management.is_new_flaky%3Atrue), which uses the following filters:

   - `@test.name:*flaky*validation*`
   - `@git.branch:validate-test-optimization`
   - `@test.retry_reason:early_flake_detection`
   - `@test.test_management.is_new_flaky:true`

### Step 3: Mitigation{% #step-3-mitigation %}

Mitigation is achieved through [Auto Test Retries](https://docs.datadoghq.com/tests/flaky_tests/auto_test_retries.md), [Flaky Test Management](https://docs.datadoghq.com/tests/flaky_management.md), and [Flaky Test Policies](https://docs.datadoghq.com/tests/flaky_management.md#configure-policies-to-automate-the-flaky-test-lifecycle). These features retry flaky tests and quarantine known flaky failures so they do not block CI.

1. In the same test that you added for Prevention, change the marker filename from `dd-validation-flaky` to `dd-validation-flaky-mitigation`. Do not rename the test function or test case. The new marker causes another intentional first-attempt failure. Keeping the test name unchanged lets Datadog associate the run with the flaky test detected during Prevention. No additional Datadog configuration is required; Auto Test Retries and Flaky Test Management handle the test during this run. Update the test for your language:

   {% tab title="JavaScript" %}

   ```javascript
   const fs = require('node:fs');
   const os = require('node:os');
   const path = require('node:path');
   
   test('flaky validation test', () => {
       // Changed from dd-validation-flaky.
       const marker = path.join(os.tmpdir(), 'dd-validation-flaky-mitigation');
       if (!fs.existsSync(marker)) {
           fs.writeFileSync(marker, '1');
           throw new Error('first attempt fails so Datadog can retry it');
       }
   });
   ```

   {% /tab %}

   {% tab title="Python" %}

   ```python
   from pathlib import Path
   from tempfile import gettempdir
   
   
   def test_flaky_validation_test():
       # Changed from dd-validation-flaky.
       marker = Path(gettempdir()) / "dd-validation-flaky-mitigation"
       if not marker.exists():
           marker.write_text("1")
           raise AssertionError("first attempt fails so Datadog can retry it")
   ```

   {% /tab %}

   {% tab title="Java" %}

   ```java
   import static org.junit.jupiter.api.Assertions.fail;
   
   import java.io.IOException;
   import java.nio.file.Files;
   import java.nio.file.Path;
   import java.nio.file.Paths;
   import org.junit.jupiter.api.Test;
   
   class ValidationFlakyTest {
       @Test
       void flakyValidationTest() throws IOException {
           // Changed from dd-validation-flaky.
           Path marker = Paths.get(
               System.getProperty("java.io.tmpdir"),
               "dd-validation-flaky-mitigation"
           );
           if (Files.notExists(marker)) {
               Files.write(marker, new byte[] { '1' });
               fail("first attempt fails so Datadog can retry it");
           }
       }
   }
   ```

   {% /tab %}

   {% tab title="Ruby" %}

   ```ruby
   require 'tmpdir'
   
   RSpec.describe 'validation flaky tests' do
     it 'flaky validation test' do
       # Changed from dd-validation-flaky.
       marker = File.join(Dir.tmpdir, 'dd-validation-flaky-mitigation')
       unless File.exist?(marker)
         File.write(marker, '1')
         raise 'first attempt fails so Datadog can retry it'
       end
     end
   end
   ```

   {% /tab %}

   {% tab title=".NET" %}

   ```csharp
   using System.IO;
   using Xunit;
   
   public class ValidationFlakyTests
   {
       [Fact]
       public void FlakyValidationTest()
       {
           // Changed from dd-validation-flaky.
           var marker = Path.Combine(Path.GetTempPath(), "dd-validation-flaky-mitigation");
           if (!File.Exists(marker))
           {
               File.WriteAllText(marker, "1");
               throw new System.Exception("first attempt fails so Datadog can retry it");
           }
       }
   }
   ```

   {% /tab %}

   {% tab title="Go" %}

   ```go
   package validation
   
   import (
       "errors"
       "os"
       "path/filepath"
       "testing"
   )
   
   func TestFlakyValidationTest(t *testing.T) {
       // Changed from dd-validation-flaky.
       marker := filepath.Join(os.TempDir(), "dd-validation-flaky-mitigation")
       if _, err := os.Stat(marker); errors.Is(err, os.ErrNotExist) {
           if writeErr := os.WriteFile(marker, []byte("1"), 0600); writeErr != nil {
               t.Fatal(writeErr)
           }
           t.Fatal("first attempt fails so Datadog can retry it")
       }
   }
   ```

   {% /tab %}

   {% tab title="Swift" %}

   ```swift
   import XCTest
   
   final class ValidationFlakyTests: XCTestCase {
       func testFlakyValidationTest() throws {
           // Changed from dd-validation-flaky.
           let marker = FileManager.default.temporaryDirectory
               .appendingPathComponent("dd-validation-flaky-mitigation")
           if !FileManager.default.fileExists(atPath: marker.path) {
               try "1".write(to: marker, atomically: true, encoding: .utf8)
               XCTFail("first attempt fails so Datadog can retry it")
           }
       }
   }
   ```

   {% /tab %}

1. Commit and push the change on the same branch:

   ```bash
   git add -A
   git commit -m "Validate Test Optimization mitigation"
   git push origin validate-test-optimization
   ```

1. Wait for CI to run, then confirm the following results:

   - In [Test Runs](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.name%3A%2Aflaky%2Avalidation%2A%20%40git.branch%3Avalidate-test-optimization%20%40test.retry_reason%3Aauto_test_retry), Auto Test Retries reruns the test after its first failed attempt, and the test passes on retry. Use [this query](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.name%3A%2Aflaky%2Avalidation%2A%20%40git.branch%3Avalidate-test-optimization%20%40test.retry_reason%3Aauto_test_retry), with the following filters:
     - `@test.name:*flaky*validation*`
     - `@git.branch:validate-test-optimization`
     - `@test.retry_reason:auto_test_retry`
   - In [Flaky Test Management](https://app.datadoghq.com/ci/test/flaky/explorer?query=%40test.name%3A%2Aflaky%2Avalidation%2A%20first_flaked_branch%3Avalidate-test-optimization%20flaky_test_state%3Aquarantined), the test appears as QUARANTINED. Its failures no longer block the test job. Use [this query](https://app.datadoghq.com/ci/test/flaky/explorer?query=%40test.name%3A%2Aflaky%2Avalidation%2A%20first_flaked_branch%3Avalidate-test-optimization%20flaky_test_state%3Aquarantined), with the following filters:
     - `@test.name:*flaky*validation*`
     - `first_flaked_branch:validate-test-optimization`
     - `flaky_test_state:quarantined`

### Step 4: Remediation{% #step-4-remediation %}

Test Optimization helps remediate flaky tests through Attempt to Fix and [Bits AI-powered flaky test fixes](https://docs.datadoghq.com/tests/flaky_management.md#bits-ai-powered-flaky-test-fixes). This section validates the Attempt to Fix workflow by fixing the same test used for Prevention and Mitigation.

1. In [Flaky Test Management](https://app.datadoghq.com/ci/test/flaky/explorer?query=%40test.name%3A%2Aflaky%2Avalidation%2A%20first_flaked_branch%3Avalidate-test-optimization%20flaky_test_state%3Aquarantined), open the quarantined validation test.

1. Click Actions, select Link commit to fix, and copy the generated key (it starts with `DD_`).

   {% image
      source="https://docs.dd-static.net/images/pr_gates/setup/attempt_to_fix_modal.5c93a1ec64a7e758e8b105f41b5839d5.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/pr_gates/setup/attempt_to_fix_modal.5c93a1ec64a7e758e8b105f41b5839d5.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="Attempt to Fix modal" /%}

1. Replace the flaky test with the passing version for your language:

   {% tab title="JavaScript" %}

   ```javascript
   test('flaky validation test', () => {
       expect(true).toBe(true);
   });
   ```

   {% /tab %}

   {% tab title="Python" %}

   ```python
   def test_flaky_validation_test():
       assert True
   ```

   {% /tab %}

   {% tab title="Java" %}

   ```java
   @Test
   void flakyValidationTest() {
       // intentionally empty - the test passes
   }
   ```

   {% /tab %}

   {% tab title="Ruby" %}

   ```ruby
   it 'flaky validation test' do
     expect(true).to be(true)
   end
   ```

   {% /tab %}

   {% tab title=".NET" %}

   ```csharp
   [Fact]
   public void FlakyValidationTest()
   {
       Assert.True(true);
   }
   ```

   {% /tab %}

   {% tab title="Go" %}

   ```go
   func TestFlakyValidationTest(t *testing.T) {
   }
   ```

   {% /tab %}

   {% tab title="Swift" %}

   ```swift
   func testFlakyValidationTest() {
       XCTAssertTrue(true)
   }
   ```

   {% /tab %}

1. Commit the fix with the generated key in the commit body. Replace `<YOUR_DD_KEY>` with the key you copied:

   ```bash
   git add -A
   git commit -m "Fix flaky validation test" -m "<YOUR_DD_KEY>"
   git push origin validate-test-optimization
   ```

1. Wait for CI to finish, then confirm the following results:

   - In [Test Runs](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.name%3A%2Aflaky%2Avalidation%2A%20%40git.branch%3Avalidate-test-optimization%20%40test.test_management.is_attempt_to_fix%3Atrue), Attempt to Fix retried the fix candidate, and every attempt passed. Use [this query](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.name%3A%2Aflaky%2Avalidation%2A%20%40git.branch%3Avalidate-test-optimization%20%40test.test_management.is_attempt_to_fix%3Atrue), which has the following filters:
     - `@test.name:*flaky*validation*`
     - `@git.branch:validate-test-optimization`
     - `@test.test_management.is_attempt_to_fix:true`
   - In [Flaky Test Management](https://app.datadoghq.com/ci/test/flaky/explorer?query=%40test.name%3A%2Aflaky%2Avalidation%2A%20first_flaked_branch%3Avalidate-test-optimization%20fix_in_progress%3Atrue), the test is marked Fix in progress. Use [this query](https://app.datadoghq.com/ci/test/flaky/explorer?query=%40test.name%3A%2Aflaky%2Avalidation%2A%20first_flaked_branch%3Avalidate-test-optimization%20fix_in_progress%3Atrue), which has the following filters:
     - `@test.name:*flaky*validation*`
     - `first_flaked_branch:validate-test-optimization`
     - `fix_in_progress:true`

### Step 5: Post-validation cleanup{% #step-5-post-validation-cleanup %}

1. Close the pull request without merging.
1. Delete the `validate-test-optimization` branch. The branch-specific Quarantine auto-rule no longer applies after the branch is deleted, and the dedicated validation service no longer receives test executions.
1. Notify the team that owns the repository that the [New Flaky Test PR Gate](https://docs.datadoghq.com/tests/guides/setup_new_flaky_pr_gate.md) remains active for the entire repository. The gate is non-blocking by default.
1. Optionally, enable the Test Optimization features configured for the `validate-test-optimization` service at the repository level.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Set up a New Flaky Test PR Gate](https://docs.datadoghq.com/tests/guides/setup_new_flaky_pr_gate.md)
- [Learn about Early Flake Detection](https://docs.datadoghq.com/tests/flaky_tests/early_flake_detection.md)
- [Learn about Auto Test Retries](https://docs.datadoghq.com/tests/flaky_tests/auto_test_retries.md)
- [Learn about Flaky Test Management](https://docs.datadoghq.com/tests/flaky_management.md)
