v1
latestOpenAPI 3.0.02026-07-141,4077,1665.2 MBTest Optimization
Search flaky tests
List endpoint returning flaky tests from Flaky Test Management. Results are paginated.
The response includes comprehensive test information including:
- Test identification and metadata (module, suite, name)
- Flaky state and categorization
- First and last flake occurrences (timestamp, branch, commit SHA)
- Test execution statistics from the last 7 days (failure rate)
- Pipeline impact metrics (failed pipelines count, total lost time)
- Complete status change history (optional, ordered from most recent to oldest)
Set include_history to true in the request to receive the status change history for each test. History is disabled by default for better performance.
Results support filtering by various facets including service, environment, repository, branch, and test state.
post/api/v2/test/flaky-test-management/tests
Request body
Example request
{
"data": {
"attributes": {
"filter": {
"include_history": true,
"query": "flaky_test_state:active @git.repository.id_v2:\"github.com/datadog/shopist\""
},
"page": {
"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==",
"limit": 25
},
"sort": "failure_rate"
}
}
}Response
OK
Example response
{
"data": [
{
"attributes": {
"attempt_to_fix_id": "I42TEO",
"codeowners": [
"@foo",
"@bar"
],
"first_flaked_branch": "main",
"first_flaked_sha": "0c6be03165b7f7ffe96e076ffb29afb2825616c3",
"first_flaked_ts": 1757688149,
"flaky_category": "Timeout",
"flaky_state": "active",
"history": [
{
"commit_sha": "abc123def456",
"policy_id": "ftm_policy.quarantine.failure_rate",
"policy_meta": {
"config": {
"failure_rate": 0.1,
"required_runs": 100
},
"failure_rate": 0.25,
"total_runs": 200
},
"status": "quarantined",
"timestamp": 1704067200000
},
{
"commit_sha": "",
"policy_id": "unknown",
"policy_meta": null,
"status": "new",
"timestamp": 1703980800000
}
],
"last_flaked_branch": "main",
"last_flaked_sha": "0c6be03165b7f7ffe96e076ffb29afb2825616c3",
"last_flaked_ts": 1757688149,
"module": "TestModule",
"name": "TestName",
"pipeline_stats": {
"failed_pipelines": 319,
"total_lost_time_ms": 1527550000
},
"services": [
"foo",
"bar"
],
"suite": "TestSuite",
"test_run_metadata": {
"duration_ms": 27398,
"error_message": "Expecting actual not to be empty",
"error_stack": "Traceback (most recent call last):\n File \"test_foo.py\", line 10, in test_foo\n assert actual == expected\nAssertionError: Expecting actual not to be empty",
"source_end": 20,
"source_file": "test_foo.py",
"source_start": 10
},
"test_stats": {
"failure_rate_pct": 0.1
}
}
}
]
}