Skip to content

A Datadog Test Optimization alternative

Mergify Test Engine retries known flaky tests inside the job, stops new ones at the pull request and keeps them from throwing pull requests out of your merge queue. It runs on any CI, with no Datadog contract.

Last updated:

The short answer

Mergify Test Engine works from inside your test framework, on any CI, and ships with the merge queue.

  • It retries the tests that are actually flaky. Datadog's Auto Test Retries reruns any failing test up to 5 times by default, so a real bug that passes once goes green. Test Engine retries a test it already knows is flaky, inside your test framework.
  • The pull request gate works with a merge queue. Datadog's own docs say PR Gates cannot be set as required on GitHub repositories that use a merge queue. Prevention blocks a flaky new test from merging either way.
  • Quarantine for every framework. Datadog's flaky test management needs its native instrumentation. Test Engine quarantines tests from any framework, JUnit XML uploads included.
  • The merge queue is in the same plan. Queue runs get the same retries and quarantine, so a flaky test never throws a pull request out of the queue.
  • No Datadog contract and no span metering. One seat price covers Merge Queue, CI Insights and Test Engine, with nothing metered on test volume.

Datadog Test Optimization vs Mergify Test Engine

From each vendor's own documentation and pricing page. Sources are listed at the bottom of the page.

What counts as flaky

Datadog Test Optimization
A test that passed and failed on the same commit
Mergify Test Engine
Passed and failed on the same commit. Every test is healthy, flaky or broken, so a real regression is never filed as noise

Retries inside the job

Datadog Test Optimization
Auto Test Retries reruns any failing test, up to 5 times by default. Restricting retries to known flaky tests is documented for Java only
Mergify Test Engine
A known flaky test is retried right where it failed, inside your test framework, so the job goes green without retrying real failures

New flaky tests on the pull request

Datadog Test Optimization
Early Flake Detection retries new tests up to 10 times. A PR Gate can block the merge, but it cannot be required on a GitHub repository that uses a merge queue
Mergify Test Engine
Prevention reruns the tests a pull request adds or changes, on the same commit, and blocks the merge if one is flaky, with or without a merge queue

Quarantine

Datadog Test Optimization
Quarantine or disable a test, by hand or through Flaky Test Policies. Requires Datadog's native instrumentation for your test framework
Mergify Test Engine
Automatic once the evidence holds, so one bad infra run does not quarantine half your suite. Released automatically when the test is healthy again. Works from JUnit XML too

Test frameworks

Datadog Test Optimization
Native libraries for .NET, Java, JavaScript, Python, Ruby, Swift and Go. Anything else uploads JUnit XML, which gets fewer features
Mergify Test Engine
Native in your test framework: pytest, Jest, RSpec, Vitest, Playwright, Go, PHPUnit, Rust, JUnit and more (15 frameworks documented)

Merge queue

Datadog Test Optimization
None
Mergify Test Engine
Mergify Merge Queue, same plan. Queue runs get the same retries and quarantine, and Fail First bisection isolates a real failure fast

CI providers

Datadog Test Optimization
Any CI provider
Mergify Test Engine
Any CI. Native GitHub Actions, Buildkite and Jenkins integrations, everything else through the Mergify CLI

Ticketing

Datadog Test Optimization
Jira issues and Datadog work items
Mergify Test Engine
Jira and Linear coming. Slack notifications and an event log today

AI agents

Datadog Test Optimization
Bits Code generates a fix and can open a pull request (preview)
Mergify Test Engine
The Mergify CLI gives your coding agent each test's health and quarantine state, so it fixes the right tests

Pricing

Datadog Test Optimization
$20 per committer a month billed yearly, $29 on demand. 1M test spans per committer, then $3 per extra million
Mergify Test Engine
$21 per active seat a month, with Merge Queue and CI Insights in the same plan. No test-volume metering. Free up to 5 contributors

Why teams look for an alternative

Datadog Test Optimization makes sense when the rest of your observability already lives in Datadog. On flaky tests, Test Engine goes further in four places.

The first is retries. By default Datadog's Auto Test Retries reruns any failing test up to 5 times, so a test that fails because of a real race condition in your code can pass on the third try and turn the build green. Test Engine retries only the tests it already knows are flaky, inside your test framework, and lets a real failure fail.

The second is the merge queue. Early Flake Detection and a "new flaky tests" PR Gate can catch a flaky test before it merges, but Datadog documents that a PR Gate cannot be required on a GitHub repository that uses a merge queue. A gate nobody is required to pass is a suggestion. Test Engine's Prevention blocks the merge on its own, and its retries and quarantine apply to the queue's CI runs as well, next to Mergify Merge Queue in the same plan.

The third is coverage. Quarantine and disable need Datadog's native instrumentation, which exists for seven languages. A PHPUnit or Rust suite can upload JUnit XML for visibility, but its flaky tests keep breaking builds. Test Engine quarantines from the same JUnit XML.

And the bill comes on top of the Datadog contract, per committer, with test spans metered past 1M per committer. Mergify charges one seat price for Merge Queue, CI Insights and Test Engine.

Moving from Datadog Test Optimization

  1. Install the Mergify GitHub App and turn on Test Engine. It is free for up to 5 contributors, then on the standard seat price.
  2. Add the Test Engine plugin for your framework, or point the Mergify CLI at the JUnit XML your jobs already write. Nothing else in your CI changes.
  3. Turn off Datadog's Auto Test Retries once Test Engine has history on your suite, so a real failure is no longer retried away.
  4. Keep Datadog for APM, logs and infrastructure. Test Engine only replaces the test layer.

Comparing more than one tool? See Mergify, Trunk, Datadog and BuildPulse side by side.

Frequently asked questions

What is the best alternative to Datadog Test Optimization?

Mergify Test Engine. It retries known flaky tests inside the job, blocks new flaky tests on the pull request, quarantines automatically on any framework and releases a test once it is healthy again. It works on any CI, and Merge Queue and CI Insights come in the same seat price.

Can Datadog PR Gates block merges when I use a merge queue?

Not as a required check. Datadog's PR Gates documentation states: "PR Gates can not be set as required on GitHub repositories using a merge queue." Mergify's Prevention blocks a flaky new test from merging whether or not you use a merge queue.

Does Datadog retry flaky tests automatically?

Yes. Auto Test Retries reruns any failing test case up to 5 times by default, whether or not it is known to be flaky. Datadog documents an option to retry only known flaky tests for Java. Mergify retries only tests it has already classified as flaky.

Do I need the Datadog tracer to quarantine flaky tests?

Yes. Datadog states that Flaky Test Management features require its native instrumentation for your test framework. JUnit XML uploads through datadog-ci give you test visibility without quarantine or disable. Mergify quarantines tests whether they come from a native plugin or from JUnit XML.

How much does Datadog Test Optimization cost?

From $20 per committer a month billed yearly, or $29 on demand. Each committer includes 1M test spans a month, and extra spans cost $3 per million. A committer is anyone with at least three commits in the month. Mergify is $21 per active seat a month for Merge Queue, CI Insights and Test Engine together, with no test-volume metering, and free for up to 5 contributors. See Mergify pricing.

Can I keep Datadog and use Mergify for tests?

Yes. Test Engine only replaces the test layer and reads your test results from CI, so Datadog can stay in place for APM, logs and infrastructure monitoring.

Is this the same as Datadog CI Visibility?

No. CI Visibility covers pipelines and jobs, and Test Optimization covers individual tests. For the pipeline side, see Mergify vs Datadog CI Visibility.

Flaky tests, handled inside the job.

Test Engine, CI Insights and Merge Queue in one plan. Free for up to 5 contributors.