testing
Skill19 starsChanged 4 months agoMITView on GitHub
Use for flaky or nondeterministic tests, especially local-vs-CI inconsistencies. Trigger on intermittent failures, race/timing symptoms, retry-only greens, or unexplained skip/xfail markers. Output should isolate reproducible cause, narrowest durable fix, and prevention guidance.
123 other projects use a version of this.
Adopted by
Most recently taken up by
- timmo001/skillstheir own version, first seen Oct 5, 2026
- kortix-ai/sunatheir own version, first seen Oct 5, 2026
- gilsmt/skillstheir own version, first seen Oct 4, 2026
- andeeplus/aplustheir own version, first seen Oct 4, 2026
- JetBrains/intellij-communitytheir own version, first seen Oct 3, 2026
- shinpr/codex-workflowstheir own version, first seen Oct 2, 2026
Used with
Projects with it also use oss-pr, pr-automation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
ffsshhttiikkSkillcicd
Continuous integration and delivery pipelines
Also in 4 projects that use this
ffsshhttiikkSkillnetworking
Practical application and coding skills for Networking
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 9 projects that use this
Cogni-AI-OUSkilldotfiles
Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.
Also in 3 projects that use this
- +2 more from CES-Ltd
- +1 more from ffsshhttiikk
Other versions123 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 123
- lobehub/lobehub★ 83ksame name
- iOfficeAI/AionUi★ 33ksame name
- JetBrains/intellij-community★ 21ksame name
- kortix-ai/suna★ 20ksame name
- modelcontextprotocol/inspector★ 11ksame name
- microsoft/fast★ 9.7ksame name
- bytebase/dbhub★ 3.6ksame name
- theopenco/llmgateway★ 1.7ksame name
- BankrBot/skills★ 1.2ksame name
- microsoft/CCF★ 875same name
113 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- debuggingSkill
- nexusSkill
- observabilitySkill
- performanceSkill
- reliabilitySkill
- shortsSkill
- skill-writerSkill
- software-engineerSkill
- token-optimizerSkill
- tutorialSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 7 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 105 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Never mark xfail/skip without a linked issue and expiry date.
- Distinctive: line 30
Test flakiness often mirrors a real production concurrency or data integrity hazard.
- Distinctive: line 76
Run at minimum 5 times before investigating.
- Distinctive: line 115
If you cannot state it in one sentence, root cause is not yet identified.
- Very specific: line 149
Ordering: add pytest --randomly-seed=random to every PR.
- Very specific: line 150
Timing: add wait_for(condition, timeout, poll_interval) helper.
- Very specific: line 151
Resource: add free_port() and tmp_dir() fixtures to conftest.py.
- Distinctive: line 159
Every investigation closes with this report.
- Very specific: line 181
Do not add time.sleep() — masks the race, breaks on slower machines.
- Very specific: line 182
Do not mark xfail/skip without a linked issue and target fix date.
- Distinctive: line 183
Do not retry in CI without investigating — retries hide failures.
- Distinctive: line 184
Do not close without a reproduction command in the ticket.
- Distinctive: line 185
Do not declare fixed after < required consecutive passes.
“Common” is measured: kept by at least 6 in 10 of the 105 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nexus Flaky Test Root Cause Analyzer
Structured protocol for diagnosing, isolating, and permanently eliminating non-deterministic test failures. Not a retry wrapper — treats flakiness as a first-class defect.
name: testing
category: testing / quality
required_context: test file path, failure frequency, CI log or local output, stack trace if available
expected_inputs: test name, framework, failure pattern, environment (local/CI/both), reproduction rate
expected_outputs: flakiness type, reproduction steps, root cause (one sentence), narrowest fix +
verification command, prevention recommendationCore Principles
- A test failing 1-in-20 runs is still failing — it is a false alarm factory.
- A retry without investigation ships unknown risk.
- Fix the root cause, not the symptom — masking a race condition makes it fail more often.
- Never mark
xfail/skipwithout a linked issue and expiry date. - Test flakiness often mirrors a real production concurrency or data integrity hazard.
Step 1 — Collect Context
Required before any investigation:
| Signal | How |
| Failure rate | Estimate from CI history (1/5? 1/100?) |
| Stack trace | Full verbatim trace from a failing run |
| Test path | Exact: tests/users/test_create.py::test_create_user |
| Framework + version | pytest --version, jest --version, go version |
| CI vs local | Fails only in CI, only locally, or both? |
| Parallelism config | -n auto, --workers, t.Parallel()? |
| Recent changes | git log --oneline -10 on test file and its imports |
If CI-only failure, diff these before reading code: runtime version, OS/arch, parallelism,
TZ / NTP, network access, env vars (missing vars silently produce defaults), I/O speed, Docker layer cache.
Step 2 — Classify Flakiness Type
| Type | Signature | Mechanism |
| Ordering | Fails after specific other tests; passes alone | Shared mutable state not reset |
| Timing | Fails on slow machines or under load | Hard-coded delays, no backoff, wall-clock assertions |
| Resource | Fails parallel, passes single-threaded | Port conflicts, shared temp dirs, DB row locks |
| Environment | Fails in CI only | Runtime delta, missing env var, OS behavior |
| External | Network errors, connection refused, timeouts | Real HTTP/DB calls in test |
| Concurrency | Assertion error varies each run; stack trace differs | Thread/async race, missing lock |
Heuristic:
- Fails when run alone → Timing / Resource / External / Concurrency
- Passes when run alone → Ordering (shared state from another test)
- Fails only in CI → Environment delta
- Failure message varies → Concurrency or External
- Fails more under parallel load → Resource contention or Concurrency
Record: Primary: <type> | Secondary: <type or none>
Step 3 — Reproduce
Run at minimum 5 times before investigating. Confirm flaky, not consistently failing.
pytest tests/path/to/test.py::test_fn -xvs # alone, verbose
pytest tests/ --randomly-seed=last -x # ordering check
pytest tests/ -n auto -x # contention check
for i in {1..20}; do pytest tests/path/to/test.py::test_fn -x --tb=no -q; done | grep -c FAILEDgo test ./pkg/... -run TestFn -count=20 -v 2>&1 | grep -E "PASS|FAIL" # Go
jest --testNamePattern "name" --runInBand --verbose # JestRecord: X/N failed, fails alone or suite-only, rate under parallelism, verbatim stack trace.
Step 4 — Identify Root Cause
Ordering: find unreset shared state — grep -n "global\|@classmethod\|setUp\|tearDown\|autouse";
look for DB rows not rolled back, in-memory caches, module-level singletons, scope="session" fixtures.
Timing: grep -rn "time.sleep\|asyncio.sleep\|setTimeout" and polling loops without timeout;
look for fixed delays insufficient on slow machines, wall-clock assertions.
Resource: grep -rn "port.*=[0-9]\{4,5\}\|localhost:[0-9]\{4,5\}" and grep -rn "tmp\|tempfile";
look for hardcoded ports, shared temp dirs, DB connections without rollback.
Environment: cat .github/workflows/*.yml | grep -E "python-version|node-version|go-version";
compare env vars between local and CI.
External: grep -rn "requests\.\|httpx\.\|fetch(\|http.Get" and real DB connection strings in tests.
Concurrency: grep -rn "threading\.\|asyncio\.\|goroutine" and missing Lock/Mutex/await.
State root cause as exactly one sentence:
"test_X fails intermittently because Y when Z."
If you cannot state it in one sentence, root cause is not yet identified.
Step 5 — Fix
Apply the narrowest fix. Do not improve unrelated code.
| Type | Wrong fix | Correct fix |
| Ordering | Delete the interfering test | Add teardown resetting shared state after each test |
| Timing | Increase time.sleep(N) | Replace with wait_for(condition, timeout=N) |
| Resource | Manually assign different port | Use port=0 or a free_port() fixture |
| Environment | Hard-code CI env locally | Parametrize via env var; test both modes in CI |
| External | Add retry in test | Mock external call; test real integration separately |
| Concurrency | Add sleep before assertion | Use lock, event, barrier, or join |
Verification — required consecutive passes by failure rate:
| Rate | Required passes |
| >20% | 20 consecutive passes |
| 5–20% | 30–50 consecutive passes |
| 1–5% | 50 consecutive passes |
| <1% | 100 passes or 30-day CI monitoring |
for i in {1..20}; do pytest tests/path/to/test.py::test_fn -x --tb=short -q; doneStep 6 — Prevention
- Ordering: add
pytest --randomly-seed=randomto every PR; fixture teardown in PR template. - Timing: add
wait_for(condition, timeout, poll_interval)helper; flag newtime.sleepin CI. - Resource: add
free_port()andtmp_dir()fixtures to conftest.py. - External: enforce
--block-networkin unit tests; separate@pytest.mark.integration. - Concurrency: shared
AsyncEventLoopfixture;asyncio_mode = "auto"in pytest.ini.
Output Contract
Every investigation closes with this report. Fill every field.
## Flaky Test Report
**Test:** [full path + test name]
**Framework:** [pytest / jest / go test / other]
**Failure Rate:** [X/N runs]
**Primary Type:** [Ordering | Timing | Resource | Environment | External | Concurrency]
**Secondary Type:** [same options, or "none"]
**Root Cause:** [one sentence — "test_X fails because Y when Z"]
**Why It Happens:** [2–3 sentences — mechanism]
**Fix Applied:** [file path + line numbers + change description]
**Verification:** [command + result — "20/20 passes"]
**Prevention:** [guardrail that stops this class from returning]
**Follow-up Needed:** [yes/no — if yes, describe]Anti-Patterns (Quick Reference)
- Do not add
time.sleep()— masks the race, breaks on slower machines. - Do not mark
xfail/skipwithout a linked issue and target fix date. - Do not retry in CI without investigating — retries hide failures.
- Do not close without a reproduction command in the ticket.
- Do not declare fixed after < required consecutive passes.
Sub-documents
| Document | Purpose |
checklists/investigation-checklist.md | Pre/during/post checklists for structured investigation |
anti-patterns/common-mistakes.md | Common wrong fixes and why they fail |
validation/output-validation.md | Fix confirmation, confidence scoring, escalation |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

