Relay

Relay AI

Detect flaky tests, auto-retry failures, and surface actionable insights from your pipeline data.

Overview

Relay AI analyzes test history, failure patterns, and timing data across your pipelines. It flags flaky tests, suggests retries, and summarizes failures so you spend less time digging through logs.

Enable Relay AI

Turn on AI features in your organization settings or per repository:

relay.yaml
ai:
  flaky_detection: true
  auto_retry:
    enabled: true
    max_attempts: 2
  insights: true

Mark tests for analysis

Relay AI inspects JUnit, TAP, and custom report formats automatically when uploaded:

jobs:
  test:
    runs-on: relay-linux-medium
    steps:
      - run: npm test -- --reporter=junit --outputFile=results.xml
      - uses: relay/upload-results@v1
        with:
          path: results.xml

Review flaky-test reports

After a few pipeline runs, open Insights → Flaky Tests to see quarantined tests, failure rates, and recommended fixes.

Flaky test detection

How detection works

Relay AI compares outcomes across branches, matrix legs, and historical runs. A test is flagged flaky when it fails intermittently without code changes.

ai:
  flaky_detection:
    threshold: 0.15
    window: 30d
    min_runs: 10

Auto-retry failed steps

Retry only steps that AI classifies as likely transient:

jobs:
  e2e:
    steps:
      - run: npm run test:e2e
        retry:
          when: relay.ai.flaky
          max: 2
          backoff: exponential

Quarantine without blocking CI

Move persistently flaky tests to a non-blocking job while you fix them:

jobs:
  quarantine:
    if: relay.ai.quarantined_tests != ''
    continue-on-error: true
    steps:
      - run: npm run test:quarantine

Failure summaries

Relay AI generates concise failure summaries on pull requests:

relay.yaml
- uses: relay/ai-summary@v1
  with:
    post-to: pull_request
    include:
      - root_cause
      - suggested_fix
      - related_commits

Advanced configuration

API Reference

Prop

Type

Best Practices

Pro Tip: Let Relay AI collect at least 10 runs on main before tuning quarantine thresholds.

  • Upload structured test results on every pipeline run
  • Start with auto-retry before quarantining to avoid hiding real failures
  • Review AI summaries on failed PRs before re-running blindly
  • Combine AI insights with deploy gates for production releases
AI enabled

On this page