When Slow Tests Stop Running, Failure Rate Lies (Agents Too)

Your failure rate is low and the trend line is flat. Leadership is happy. But last sprint, a few slow integration tests started timing out, got labelled infrastructure noise, and were quietly excluded by different engineers on different teams. The suite is now smaller, faster and less honest. The metric did not move because the tests most likely to catch real regressions stopped running.

This is one of the most common failure modes in mature CI pipelines: failure rate improves because the tests doing the hardest work left the denominator, not because quality improved. Agentic quality engineering adds a new way for it to happen. A coding agent asked to make a pipeline faster or greener can add a @slow marker, narrow a test selection expression or raise a job filter in seconds, with a perfectly reasonable commit message, and no one may notice the effect on coverage. Long-running agent evals are equally easy to drop from the default run because they are slow and cost money per call.

This article shows how to detect execution dropout, the SQL and dashboard queries that surface missing tests, CI gates that block silent erosion, and how to apply the same checks to changes made by agents.

Build an API Automation Framework With Node.js

Learn Node.js, Cucumber, GitHub Copilot, APIs, CI/CD, and modern automation by building a complete framework.

Learn more

How Slow Tests Disappear Without Anyone Noticing

Slow tests don't get deleted in a single PR — they erode. A test that intermittently exceeds a job-level timeout gets retried, fails again, and an engineer adds it to an exclusion list to unblock the release. A Playwright end-to-end test that takes 90 seconds in a 5-minute job budget gets tagged @slow and excluded from the default run profile. A Pytest mark filter that someone added in 2022 to speed up PR checks never gets revisited, so an entire module silently stops running in the main branch pipeline. Each decision is locally rational. The aggregate effect is a suite that reports on a shrinking, increasingly optimistic slice of your system.

The key insight is that failure rate is a ratio: failures divided by executions. When slow tests stop executing, the denominator shrinks and the numerator stays low — because the tests most likely to fail under load, latency, or resource contention are exactly the ones that run long. Your test dashboard shows a healthy rate. What it doesn't show is that the execution count per test case has been drifting downward for six weeks. That drift is the signal worth tracking.

Detecting Execution Dropout in Your CI Test Dashboard

The first thing to instrument is expected vs. actual execution count per test, not just pass/fail. If you're storing JUnit XML results in PostgreSQL or ClickHouse, this query gives you the tests that ran fewer times this week than their 30-day average:

-- PostgreSQL: tests with execution dropout (last 7 days vs. 30-day baseline)
WITH baseline AS (
  SELECT
    test_id,
    test_name,
    AVG(daily_runs) AS avg_daily_runs
  FROM (
    SELECT
      test_id,
      test_name,
      DATE(executed_at) AS run_date,
      COUNT(*) AS daily_runs
    FROM test_results
    WHERE executed_at >= NOW() - INTERVAL '30 days'
    GROUP BY test_id, test_name, DATE(executed_at)
  ) daily
  GROUP BY test_id, test_name
),
recent AS (
  SELECT
    test_id,
    COUNT(*) AS runs_last_7d
  FROM test_results
  WHERE executed_at >= NOW() - INTERVAL '7 days'
  GROUP BY test_id
)
SELECT
  b.test_name,
  b.avg_daily_runs * 7 AS expected_runs,
  COALESCE(r.runs_last_7d, 0) AS actual_runs,
  ROUND(
    100.0 * (1 - COALESCE(r.runs_last_7d, 0) / NULLIF(b.avg_daily_runs * 7, 0)),
    1
  ) AS dropout_pct
FROM baseline b
LEFT JOIN recent r USING (test_id)
WHERE COALESCE(r.runs_last_7d, 0) < b.avg_daily_runs * 7 * 0.7
ORDER BY dropout_pct DESC
LIMIT 50;

A dropout threshold of 30% (i.e., a test ran less than 70% of its expected frequency) is a reasonable starting alert boundary. Wire this query to a Grafana panel using a PostgreSQL data source and set a threshold annotation at 30%. When the panel goes red, you have a list of candidates to investigate — not a vague "something feels off" conversation.

On the CI side, GitHub Actions makes it straightforward to emit test execution metadata alongside results. Add a step that counts executed tests and compares against a committed baseline file:

# .github/workflows/test.yml (partial)
- name: Validate test execution count
  run: |
    ACTUAL=$(python scripts/count_executed_tests.py reports/)
    EXPECTED=$(cat .test-baseline/expected_count.txt)
    if [ "$ACTUAL" -lt $(( EXPECTED * 70 / 100 )) ]; then
      echo "::error::Test execution dropout detected: expected $EXPECTED, got $ACTUAL"
      exit 1
    fi
  shell: bash

The count_executed_tests.py script parses JUnit XML and sums the tests attribute minus the skipped attribute across all <testsuite> elements. Committing the baseline to the repo means any PR that silently reduces the suite size fails the check explicitly — no more invisible erosion. Linking the Grafana dropout panel to Loki log queries that show which exclusion flags were active during each run makes "why did failure rate drop?" investigations much shorter.

For duration-based dropout specifically, correlate test duration percentiles with execution frequency. If a test's P95 runtime exceeds 80% of your job timeout budget, it's statistically likely to get cut. Test duration variance exposes more instability than failure rate precisely because high-variance tests are the ones that blow timeouts non-deterministically — they don't disappear all at once, they disappear in bursts, which makes the dropout pattern jagged and easy to dismiss as noise.

The Instrumentation Gaps That Let Dropout Go Undetected

The most common mistake is tracking only the tests that ran, not the tests that should have run. Every test results dashboard — Allure, ReportPortal, Datadog CI Visibility, your homegrown ClickHouse pipeline — defaults to showing you what executed. None of them natively alert on what didn't. Allure is excellent for per-run drill-down and history trends when you control the reporting pipeline; ReportPortal adds cross-launch analytics and ML-based failure clustering at scale, but neither will fire an alert when a test case's execution frequency drops 40% over two weeks unless you build that query yourself. The tooling isn't broken — the mental model is. Teams instrument outcomes; they forget to instrument coverage of execution.

A second failure mode is conflating skip with dropout. A skipped test appears in the JUnit XML with a <skipped/> element — it's visible, countable, and affects your rates in documented ways (as covered in detail when examining how skipped tests distort every rate you report). A dropped test never appears in the XML at all. Engineers who audit skips feel like they're covering the gap. They're not. Dropout requires a different detection strategy: comparing current execution counts against historical baselines, not inspecting the results file that was actually produced.

Execution Dropout Caused by Agents, and in Agent Evals

The execution-count gate above catches dropout regardless of who caused it, which is the point. Two additions make it work well when coding agents edit the pipeline.

Treat selection changes as reviewed changes. Exclusions live in a few predictable places: pytest markers and -m expressions, addopts in configuration files, Playwright grep or testIgnore settings, and workflow path filters. Use a CODEOWNERS entry so changes to those files need approval from the team that owns the suite, and state the rule in the agent's repository instructions: do not exclude, skip or move tests to another job to speed up or unblock a build; propose it in the pull request description instead. If a slow test genuinely belongs in a nightly job, the baseline file is updated in the same reviewed change, which leaves a paper trail.

Give evals their own execution baseline. Tests that call a model or drive an agent are slow and cost money per run, so they are prime candidates for quiet removal. They also need a minimum number of samples to mean anything. Track the expected sample count per eval and alert on both kinds of dropout: an eval that stopped running, and one still running with too few samples to compare against its threshold.

-- Evals whose sample count this week fell below the agreed minimum
SELECT eval_name, COUNT(*) AS samples_7d
FROM eval_results
WHERE run_at >= NOW() - INTERVAL '7 days'
GROUP BY eval_name
HAVING COUNT(*) < 50;

An eval with no rows at all will not appear in that result, so pair it with the same expected-versus-actual comparison used for ordinary tests. A pass rate computed from a handful of samples looks as healthy on a dashboard as one computed from hundreds, which is exactly the problem this article describes.

Myths That Keep Failure Rate Looking Cleaner Than It Is

Myth 1: A stable failure rate means a stable suite. Stability in the metric is compatible with significant churn in what's being measured. If your suite loses 15% of its slowest tests over a quarter, failure rate can stay flat or improve while real regression risk accumulates. The metric is stable because it's measuring a different thing each week. Pair failure rate with an execution-count trend and a suite-size trend before drawing any quality conclusions. Myth 2: Timeout failures are infrastructure problems, not test problems. When a test times out consistently, the instinct is to blame the environment and exclude the test. Sometimes that's right. But a test that times out under realistic load is telling you something about the system under test — that behavior under contention is undefined, slow, or broken. Excluding it removes the signal, not the problem.

Myth 3: Faster pipelines are always better pipelines. Speed is a real constraint — a 45-minute PR check is a developer experience problem. But the answer is parallelization and smarter test selection, not silent exclusion of the tests that take longest. When pipeline speed improvements come from dropping test coverage rather than from infrastructure investment, the pipeline is faster and less trustworthy. Track pipeline duration and suite execution count as separate KPIs. If duration drops while execution count also drops, that's not an improvement — it's a trade-off that deserves an explicit decision, not an accidental one buried in a timeout config.

Failure rate is a useful signal when the denominator is honest. The work is making sure it stays honest: commit an execution baseline, query for dropout weekly, and treat a shrinking suite as a first-class alert — not a side effect of pipeline optimization. If you're building out the broader KPI layer around this, the first-attempt pass rate and failure signature KPIs give you the complementary view on what ran and how it failed, once you've confirmed that what should run actually did.

Note: This article is for informational purposes only and is not a substitute for professional advice. If you need guidance on specific situations described in this article, consider consulting a qualified professional.

Understanding how systems actually work is the first step toward navigating them effectively.

Browse all articles