flake-axis-bisection
БесплатноБез исполняемых скриптовНе проверенUse when one test is known to fail intermittently and reading its code has not explained why. Varies one condition at a time (isolation, order, workers…
от testland★ 18 звёзд на GitHubОб этом скилле
flake-axis-bisection
A non-deterministic test is one that "sometimes pass[es] and sometimes fail[s], without any noticeable change in the code, tests, or environment" (Fowler, Eradicating Non-Determinism in Tests). That definition is the problem in a nutshell: nothing visible changed, so inspection has nothing to grip. This skill is the experiment that manufactures a visible change. Pick one condition, move it, and see whether the failure rate moves with it.
The term "flaky test" is practitioner-emergent, popularized by the Google Testing Blog (Flaky Tests at Google); there is no standards-body definition behind it.
What this owns, and what it does not
Owns: the empirical protocol. One test, one axis at a time, a counted outcome per variation, and an explicit rule for deciding whether the difference between two counts is signal or noise.
Does not own: the catalog. A flake-pattern catalog (for example
flake-pattern-reference) classifies a flake by inspection: read the
symptom, match it to a named pattern, apply the pattern's remediation.
This protocol classifies by experiment: you do not need to recognize
the symptom, because you produce the evidence. Use a catalog to give
the result a name and a fix once the sweep points at an axis. Use this
skill when the catalog's decision tree has already been walked and two
or more patterns still fit.
Does not own: commit search. Finding which commit introduced a failure is a search over revision history and applies to a test that now fails every time. This is a search over execution conditions for a test that fails only sometimes. If the test fails 20 times out of 20, stop: it is not flaky, and the sweep below will tell you nothing.
Does not own: the fix. The output is an implicated axis plus the evidence for it. Remediation is a separate step.
Vocabulary used below
| Term | Meaning |
|---|---|
| Axis | One condition being varied (worker count, execution order, viewport). |
| Variation | One setting of an axis (--workers=1, --workers=4). |
| N | Number of executions of the target test at one variation. |
| k | Number of those executions that failed. |
| Reproduction rate | The point estimate k/N. An estimate, never the truth. |
| Baseline | The project's standard configuration, measured the same way. |
Step 1: pin everything except one axis
The sweep is only interpretable if exactly one thing differs between a variation and the baseline. Before the first run, freeze:
- the commit under test, and the dependency lockfile,
- the machine class or container image (a sweep split across a laptop and a CI runner silently varies the environment axis inside every other axis),
- the random seed policy. Either seed every source to a fixed value, or
record the seed per run so a failure can be replayed. Jest prints the
seed with
--showSeedand accepts--seed=<num>, and its docs note that "when dealing with flaky tests, rerunning with the same seed might help reproduce the failure" (Jest CLI).
If the target test cannot be run in isolation from the rest of the suite, that fact is itself the first result: the isolation axis is already implicated.
Step 2: choose N before you run anything
N is not a taste question. It follows from the smallest failure rate you
need to be able to see. If a test truly fails with probability p on
independent runs, the chance that N runs produce zero failures is
(1 - p)^N; solving (1 - p)^N = 0.05 gives the N at which you have a 95%
chance of seeing at least one failure. The full p-to-N table and its
derivation are in
references/reproduction-rate-statistics.md.
The one number to remember: a test that really fails 5% of the time still
shows a clean 0/20 more than a third of the time. N=20 is a screening
depth - enough to separate a roughly 40% flake from a roughly 5% flake, not
enough to separate 5% from 10%.
Cost. Total executions are axes x variations x N. The sweep below
has 8 axes with 2 to 4 variations each, so N=20 costs roughly 320 to 640
executions of one test, and N=60 costs roughly 1,000 to 1,900. This is
the reason the protocol is run against a single named test rather than
across a suite. Runners support the repetition directly: Playwright's
--repeat-each <N> runs "each test N times (default: 1)"
(Playwright CLI).
Practical compromise (a convention, not a standard): screen all axes at N=20, then re-measure only the baseline and the one or two implicated variations at N=60 or higher before acting. Nothing in the statistics endorses N=20; it is a budget choice, and its consequences are the ones tabulated in the reference.
Step 3: measure the baseline
Run the target test N times under the project's
Установить flake-axis-bisection в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл flake-axis-bisection?
Use when one test is known to fail intermittently and reading its code has not explained why. Varies one condition at a time (isolation, order, workers, viewport, latency, repetition), counts passes and failures with confidence intervals, and walks shared resources once parallelism is implicated.
Как установить скилл flake-axis-bisection?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл flake-axis-bisection запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic