fixing-flaky-tests

Diagnose and fix flaky tests failing under concurrent execution.

127|19|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/rileyhilliard/claude-essentials --skill fixing-flaky-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixing-flaky-tests
Source: https://github.com/rileyhilliard/claude-essentials/tree/main/plugins/ce/skills/fixing-flaky-tests
Command: npx skills add https://github.com/rileyhilliard/claude-essentials --skill fixing-flaky-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Diagnoses and fixes flaky tests that pass in isolation but fail when run concurrently.

Core Features & Use Cases

  • Isolation patterns for shared state across tests to prevent cross-test pollution.
  • Race-condition handling with condition-based-waiting and synchronized waits.
  • Resource-conflict mitigation for ports, files, or global resources across workers.

Quick Start

Start by running the test suite multiple times to reproduce flakiness, then apply isolation patterns (per-test transactions, per-worker resources), and validate stability by rerunning with parallelism.

Frequently Asked Questions about fixing-flaky-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my tests pass in isolation but fail when run concurrently?

Tests passing in isolation but failing concurrently usually indicate flaky tests caused by shared state, cross-test pollution, or race conditions. This Skill diagnoses and fixes these concurrency issues by applying isolation patterns and synchronized waits.

How do I fix flaky tests caused by shared database state and resource conflicts?

To fix flaky tests caused by shared database state, this Skill applies per-test transactions and resource isolation patterns. It mitigates resource conflicts for ports, files, or global resources across concurrent workers to ensure deterministic execution.

What is the best way to handle race conditions in asynchronous test suites?

The best way to handle race conditions in asynchronous test suites is using condition-based-waiting for reliable operations. This Skill implements synchronized waits to resolve race conditions and ensure deterministic test execution across concurrent processes.

Can I use these test isolation patterns for both Python and JavaScript suites?

Yes, you can use these test isolation patterns for both Python and JavaScript test suites. The Skill diagnoses flaky tests across languages, handling shared databases, global state, and file locks across different programming environments.

How do I reproduce and validate fixes for flaky tests running in parallel?

To reproduce and validate flaky test fixes, run the test suite multiple times to trigger failures, then apply per-worker resource management. Validate stability by rerunning the suite with parallelism enabled to confirm the fixes resolved the flakiness.

What are the limitations of using shared state isolation patterns for test execution?

Shared state isolation patterns require identifying specific cross-test pollution sources like global variables or file locks. If resource conflicts are highly dynamic or rely on external system states, deterministic execution may be harder to achieve without per-test resource management.