Skip to content
Back to skills

Orbit Qa Flaky Detector

ASecurity

Detect flaky Playwright tests — runs each spec N times, flags any that pass-then-fail-then-pass, ranks by flakiness rate, suggests root causes (timing, network, parallelism, state leak). Use when the user says "flaky tests", "intermittent failure", "CI flaky", "test passes locally fails in CI".

  • 225 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 4, 2026
researchrustbashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill orbit-qa-flaky-detector --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Orbit Qa Flaky Detector?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Orbit Qa Flaky Detector
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-orbit-qa-flaky-detector/badge)](https://www.skillsdirectory.com/skills/neversight-orbit-qa-flaky-detector)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: orbit-qa-flaky-detector
description: Detect flaky Playwright tests — runs each spec N times, flags any that pass-then-fail-then-pass, ranks by flakiness rate, suggests root causes (timing, network, parallelism, state leak). Use when the user says "flaky tests", "intermittent failure", "CI flaky", "test passes locally fails in CI".
---

# 🪐 orbit-qa-flaky-detector — Flaky Playwright test detector

A flaky test is worse than no test — it trains the team to ignore failures. This skill catches them by running tests many times and ranking pass-rate.

---

## Quick start

```bash
bash ~/Claude/orbit/scripts/detect-flaky.sh --runs 10
```

Output: `reports/flaky-<timestamp>.md`.

---

## How it works

1. Run the full Playwright suite N times (default 10)
2. Record pass/fail per spec per run
3. Compute pass rate
4. Rank: 100% pass = stable, < 100% = flaky
5. For each flaky, propose root-cause hypothesis based on failure pattern

---

## Pass-rate interpretation

| Rate | Verdict |
|---|---|
| 100% | Stable. Trust it. |
| 90-99% | Mildly flaky — investigate but not urgent |
| 60-89% | Flaky — deprioritise CI block, fix soon |
| < 60% | Broken — disable + fix |

---

## Common flaky causes + diagnostics

### Timing (race condition)
**Whitepaper intent:** A test that passes at 60ms and fails at 200ms is racing the page. Use Playwright's auto-wait, never `waitForTimeout`.

```js
// ❌ Hard-coded wait
await page.waitForTimeout(500);

// ✅ Wait for actual condition
await page.locator('.my-component').waitFor({ state: 'visible' });
```

### Parallelism / shared state
Tests using the same DB record concurrently corrupt each other. Mark state-mutating tests `serial`:
```js
test.describe.configure({ mode: 'serial' });
```

### Network jitter
Real network calls in tests are flaky. Mock:
```js
await page.route('**/api/**', route => route.fulfill({ status: 200, body: '{}' }));
```

### Browser inconsistencies
Same test passes on Chromium, fails on WebKit. Often a subtle CSS / event-bubbling difference. Pin to one browser if you don't actually need cross-browser.

### Auth state expiry
Cookies expire mid-suite. Re-auth before each test or use Playwright's `storageState`.

### Animation
Element measured mid-fade-in, value flips. Disable animations:
```js
await expect(page).toHaveScreenshot('x.png', { animations: 'disabled' });
```

---

## Output

```markdown
# Flaky Test Detector — my-plugin (10 runs)

## Stable: 38/42 specs (90%)

## Flaky (4 specs)
- ❌ flows/checkout.spec.js > "Complete purchase" — 5/10 pass (50%)
   → Failure pattern: retry succeeds → likely race condition
   → Suggested fix: add explicit wait for stripe.elements ready

- ⚠ blocks/dynamic-list.spec.js > "Load 100 items" — 8/10 (80%)
   → Failure pattern: timeout
   → Suggested fix: increase timeout for this test, or batch items

- ⚠ admin/settings.spec.js > "Save settings" — 9/10 (90%)
   → Failure pattern: passed except run 7 — auth cookie expired mid-suite
   → Suggested fix: add beforeEach re-login or refresh storageState

- ⚠ visual/cards.spec.js > "Card spacing" — 7/10 (70%)
   → Failure pattern: pixel diff > 2%
   → Suggested fix: animations disabled missing
```

---

## Pair with

- `/orbit-playwright` — debug flaky tests with trace viewer
- `/orbit-qa-snapshot-cleanup` — stale snapshots cause visual flakiness

---

## Sources & Evergreen References

### Canonical docs
- [Playwright — Flaky tests](https://playwright.dev/docs/test-retries) — auto-retry strategies
- [Playwright Best Practices](https://playwright.dev/docs/best-practices) — root-cause patterns
- [Stripe Engineering — Reducing Flaky Tests](https://stripe.com/blog/the-secret-to-reducing-flaky-tests) — case study

### Last reviewed
- 2026-04-29

Files in this skill

  • SKILL.md3.7 KB
  • description_ar.txt570 B
  • description_cn.txt341 B
  • description_de.txt458 B
  • description_en.txt298 B
  • description_es.txt378 B
  • description_fr.txt426 B
  • description_it.txt402 B
  • description_ja.txt519 B
  • description_ko.txt449 B
  • description_ru.txt720 B
  • description_tw.txt344 B
  • stats.json68 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in research →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.