Skip to content
Development
Agent

flaky-tests

Tuist Test Insights helps developers and agents distinguish intermittent failures from repeatable regressions using shared test history. Start with Tuist's supported test-reporting integration to investigate inconsistent outcomes; supported quarantine workflows can contain known

From plugin
tuist
5.9k46 skills46 agents

Claude Code

$ npx -y skills add tuist/tuist --agent claude-code

Agent definition

flaky-tests.md

Tuist: my tests are flaky

Tuist Test Insights helps developers and agents distinguish intermittent failures from repeatable regressions using shared test history. Start with Tuist's supported test-reporting integration to investigate inconsistent outcomes; supported quarantine workflows can contain known flakes while the team repairs the cause.

Why flaky tests are expensive

A flaky test passes and fails on the same code. Each failure costs more than a rerun:

  • **Blocked merges.** A red check stops a pull request until someone retries it, and in a merge queue it can hold up everyone behind it.
  • **Wasted investigation.** Someone has to decide whether the failure is real. Without history, that means reading logs from scratch every time.
  • **Eroded trust.** Once a team learns that red often means nothing, real regressions get retried and merged too.
  • **Hidden cost.** Blanket retries turn a flaky test green, so the cost moves into longer jobs and extra machine time instead of disappearing.

Common causes are shared state between tests, timing assumptions and fixed waits, test order dependence, unavailable external services, and resource pressure on the machine; [What is a flaky test?](/en/docs-markdown/references/concepts/flaky-test) explains each one. Tuist does not guess which one applies. It records every attempt, so the evidence points to the cause.

How Tuist addresses it

  • **Detection from history.** Tuist marks a test as flaky when it fails and passes on the same code, both within a run's retries and, for supported integrations, across separate CI runs. See [flaky-test detection](/en/docs-markdown/guides/features/test-insights/flaky-tests).
  • **Containment.** Quarantine mutes or skips a known flaky test, manually or through an automation threshold, so it stops blocking merges while it is fixed. Every change is recorded.
  • **Shared evidence.** Developers, reviewers, and authorized coding agents see the same attempts and failure messages, and teams can get [Slack alerts](/en/docs-markdown/guides/integrations/slack) when a test becomes flaky.

Diagnose before retrying everything

A test that fails and passes on the same code is a useful flakiness signal, not proof that the test itself is at fault. Compare failure messages, repetitions, branches, toolchain versions, machine conditions, and external dependencies. Record all attempts, not just the final successful retry.

| Symptom | What to investigate | Where Tuist helps | | --- | --- | --- | | A rerun passes without a code change | Repeated outcomes, setup, timing, and failure details | [Test Insights](/en/docs-markdown/guides/features/test-insights) and [flaky-test detection](/en/docs-markdown/guides/features/test-insights/flaky-tests) build a shared history. | | Many unrelated tests fail together | Runner pressure, simulator state, shared fixtures, and service availability | Compare individual test runs with the surrounding build and CI job, rather than quarantining the whole suite. | | The same flaky test repeatedly blocks merges | Failure frequency, owner, and repair plan | Quarantine where supported, with a clear condition for restoring the test. | | A failure is consistent after a change | Reproducibility and regression evidence | Treat it as a possible regression, not an automatic flake. |

Project first, environment second

Use the project's failure history to repair shared state, timing assumptions, and unreliable dependencies before scaling its execution environment. Check runner conditions when evidence points there, but do not treat a faster machine as a fix for an unexplained flake. Supported Gradle, Bazel, Elixir, and Xcode reporting can ground that investigation without moving CI.

Contain failures without losing accountability

[Tuist Tests](/marketing-markdown/tests) separates detection from quarantine. A **muted** test still runs but its failure does not fail the run. A **skipped** test does not execute and supplies no fresh result. Neither fixes the underlying defect.

Quarantine can be manual or automated where supported. Assign an owner, keep a repair issue, and periodically review whether a muted test has become reliable. Prefer retaining execution when that evidence is useful; skipping may be appropriate when a test cannot safely run.

Detection supports Xcode, Gradle, Bazel, and Elixir, with integration-specific requirements. Elixir supports cross-run detection without retries and mute/skip quarantine with recent authenticated `tuist_ex` versions. Muting has restrictions with umbrella-root runs and `--warnings-as-errors`; failed policy lookups run all tests. Xcode quarantine requires the Tuist test wrapper rather than arbitrary `xcodebuild` execution. Check the [support matrix](/marketing-markdown/tests), including Cargo and canary Struo support, before enabling a policy.

Investigate with an agent

Through the authorized [Tuist MCP server](/en/docs-markdown/guides/features/agentic-coding/mcp), an agent can use `list_test_cases` with the flaky filter, inspect metrics with `get_test_case`, and read attempts and failures with `list_test_case_runs` and `get_test_case_run`. Available attachments can add evidence.

Ask it to group failure signatures, distinguish shared-environment failures from test-specific behavior, and propose a reproducible fix. Test state can be changed through `update_test_case`; that is a write operation and can trigger configured webhooks. Approve a quarantine policy before applying changes, and keep an owner responsible for restoring coverage.

First experiment

1. Enable [Test Insights](/en/docs-markdown/guides/features/test-insights) for the current toolchain and collect real runs. 2. Select one frequently failing test and inspect every reported attempt, not only the green rerun. 3. Reproduce the likely cause, such as shared state, an unbounded wait, or an unavailable dependency. Apply a targeted fix; quarantine only if containment is needed. 4. Measure failure a

Read more
@tuist
Ships withtuist

Tuist is a build platform for engineering teams and their coding agents. It works with Xcode, Gradle, Bazel, Elixir, and Rust builds. Features vary by toolchain: Rust compilation caching is experimental, and Once support is in canary.

5.9k13 skills46 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
5.9k
Star history of tuist/tuist on GitHub, a chart by star-history.com

Other agents on tuist.

about

about

Agent

Tuist is build infrastructure for engineering teams and coding agents. Shared infrastructure connects building, testing, and…

@tuist@tuistInstall Agent
blog

blog

Agent

Engineering articles from Tuist on build infrastructure, developer workflows, and coding agents, with product updates and…

@tuist@tuistInstall Agent
brand

brand

Agent

Official Tuist logos and wordmarks for referring to Tuist in documentation, integrations, presentations, and press.

@tuist@tuistInstall Agent
bazel-vs-gradle

bazel-vs-gradle

Agent

Bazel and Gradle both build JVM, Android, and multi-language projects, and many organizations run both: Gradle for Android apps…

@tuist@tuistInstall Agent
bazel

bazel

Agent

Tuist brings Bazel-native depth to one productivity platform for organizations with diverse build systems. Its remote action…

@tuist@tuistInstall Agent
elixir

elixir

Agent

Tuist brings Mix- and ExUnit-native depth to one productivity platform for organizations with diverse build systems. The…

@tuist@tuistInstall Agent

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react9d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex9d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman10d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about flaky-tests.

Which coding agents can use flaky-tests?
flaky-tests installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.