Skip to content

Slash command

Flaky test hunter

Finds the tests that fail on a bad day, works out which kind of flake each one is, and fixes the cause instead of adding a retry.

About

Finds the tests that fail on a bad day, works out which kind of flake each one is, and fixes the cause instead of adding a retry.

Files in v1.0.0

  • replicamd.plugin.json2364 B
  • skills/tests-that-do-not-lie.md2542 B

Contributes

{
  "commands": [
    {
      "id": "hunt",
      "title": "Find flaky tests",
      "prompt": "Find tests in this project that pass and fail without the code changing.\n\nRead the test sources looking for the causes rather than the symptoms:\n- real time: `Date.now()`, `new Date()`, timezone-dependent formatting, tests that break near midnight or on the 29th\n- real waiting: `sleep`, fixed timeouts, polling with a race against the thing it polls\n- ordering: shared module state, a database or temp directory not reset between tests, tests that pass alone and fail in a suite\n- unawaited work: a promise nobody awaits, a listener never removed, an interval never cleared\n- the network, the filesystem, or a port that another test also wants\n- randomness without a fixed seed\n\nFor each candidate name the file, the mechanism, and the conditions under which it fails. Then, if the suite is fast enough, run it several times in a row and tell me which ones actually moved - a measured flake beats a suspected one.\n\nDo not propose retries. A retry hides the flake and keeps the cost."
    },
    {
      "id": "fix",
      "title": "Fix one flaky test",
      "prompt": "Take the test I name and make it deterministic.\n\nReplace real time with an injected or faked clock. Replace sleeps with waiting on the actual condition. Give the test its own temp directory, its own database, its own port. Reset shared state in a hook rather than hoping the previous test did. Seed any randomness and print the seed on failure so a bad run can be reproduced.\n\nThen prove it: run the single test at least twenty times and report the pass count. If it is not twenty out of twenty, say so rather than declaring it fixed - and if you cannot make it deterministic, say what would have to change in the code under test, because at that point the test is telling you about a real race."
    }
  ],
  "skills": [
    "skills/tests-that-do-not-lie.md"
  ]
}

Versions

  • v1.0.07/26/2026 · 2 files

Install

Install in ReplicaMD

Nothing happened? ReplicaMD may not be installed yet - or open it first, then Settings → Plugins and install by id.

Plugin id:

flaky-hunter

Bundle endpoint:

https://replicamd.nl/api/registry/plugins/flaky-hunter/download
Author
Ardjun Debi - Tewarie @ardjun
Latest
v1.0.0
License
MIT
Installs
0
testingciquality