agentsclimarketplace

Absolute deflake

Skill maddhruv/absolute/skills/absolute-deflake

Absolute Skills to 10x your Development Lifecycle

Install
npx -y skills add maddhruv/absolute --skill absolute-deflake

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Flaky test fixes: detect nondeterministic tests empirically (repeat/shuffle/parallel runs), diagnose the root cause, fix it β€” never retry/skip/sleep β€” and verify across many randomized runs. Triggers on "absolute deflake", "fix flaky tests", "CI is flaky", "this test fails randomly/intermittently".

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.9 KB, as published. Nobody here has run it

Start your first response with the πŸ§ͺ emoji.

Absolute Deflake

Find tests that pass and fail nondeterministically, diagnose the root cause of each, and fix it β€” not by retrying or skipping, but by removing the source of nondeterminism. Output is evidence (failure rate per test) β†’ cause β†’ fix, verified by repeated runs.

Runs the shared engine in references/health-engine.md β€” read it for the DETECT β†’ SCAN β†’ TRIAGE β†’ FIX β†’ VERIFY β†’ REPORT loop and the safety contract. This file covers only what's specific to flaky tests.


When to use

  • "Our CI is flaky", "this test fails randomly", "fix the intermittent failures".
  • A test passes locally but fails in CI (or vice versa), or fails ~1 in N runs.
  • Burning down a backlog of retry/skip-marked tests that mask real flakiness.

Not for tests that fail deterministically β€” that's a real bug or a real regression (/absolute work for a fix, or just fix it). deflake targets nondeterministic failures.


What it scans

Establish flakiness empirically β€” a test isn't flaky because someone said so. Use preferences.health.deflakeRuns from config as the default N for repeat-runs (else 20):

EcosystemRepeat-run / detect
Jest/Vitestrun suite NΓ— (--run loop), randomize order (--shuffle / testSequencer)
pytestpytest-randomly + pytest --count=N (pytest-repeat); -p no:randomly to A/B
Gogo test -count=N -shuffle=on ./..., -race

Also mine signals: existing retry/flaky/skip annotations, CI history if reachable, and run the suite both in isolation and in full/parallel β€” order- and concurrency- dependent failures only show one way. Record a failure rate per suspect test.


Common root causes (diagnose, don't guess)

CauseTellFix
Test-order / shared statepasses alone, fails in suite (or vice versa)isolate state; reset/teardown between tests
Time / clockfails near midnight, DST, or under loadfake timers / inject clock; no real sleep
Async race / missing awaitfails under parallelism or slow CIawait the actual condition; no fixed timeouts
Randomnessfails ~X% with no patternseed the RNG; fix the seed in tests
Network / external I/Ofails offline or on slow linksmock/stub the boundary
Unordered collectionsfails on map/set iteration ordersort before asserting
Resource leak / port reusefails on repeat or parallel runsunique resources; clean up

Risk ranking (TRIAGE)

WaveClassDefault
1clear, isolated cause (seed, await, fake clock, sort)fix now
2shared-state / ordering β€” needs fixture refactorfix this pass, per test
3flakiness pointing at a real product race, not just the testgated β€” surface; may be a genuine bug to fix in code

A flaky test sometimes means the code has a race, not the test. Don't "stabilize" the test into hiding a real concurrency bug β€” flag wave-3 cases for a real fix.


Fix & verify

  • Fix the cause. Then prove it: re-run the test many times (and shuffled / parallel / with -race) β€” green once is not deflaked; green across N randomized runs is.
  • Remove the retry/skip/flaky annotation that was masking it once the cause is fixed.
  • Never "fix" by adding retries, raising timeouts blindly, sleep, or skipping the test β€” that hides flakiness, doesn't remove it.
  • Re-run the full suite to confirm the fix didn't destabilize neighbors.

Gotchas

  1. Retry/skip as a fix. Masks the flake, ships the nondeterminism. Forbidden here.
  2. sleep to dodge a race. Slows the suite and still flakes under load. Await the condition.
  3. One green run = done. Flakes are probabilistic β€” verify with many randomized runs.
  4. Stabilizing a real product race. If the code races, fix the code, not just the assertion.
  5. Ignoring order/parallel dimension. Run isolated and in-suite; the bug hides in whichever you skip.

Companion commands

  • /absolute upgrade β€” a flaky suite makes upgrade verification unreliable; deflake first.
  • /absolute debt β€” flaky-test annotations are test debt; this clears them at the root.
  • /absolute work β€” when the flake is a genuine product-code race needing real design.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.