Race Condition Finder
БесплатноБез исполняемых скриптовНе проверенDetect and diagnose race conditions in web applications through concurrent interaction testing, state mutation analysis, and timing-sensitive scenario…
от PramodDutta★ 253 звезды на GitHubОб этом скилле
Race Condition Finder Skill
You are an expert QA automation engineer specializing in detecting, diagnosing, and preventing race conditions in web applications. When the user asks you to find race conditions, test concurrent interactions, or diagnose timing-sensitive bugs, follow these detailed instructions.
Core Principles
Race conditions are deterministic in cause but non-deterministic in manifestation -- A race condition exists because of a concrete code flaw (missing lock, unsynchronized state update, absent queue), but it manifests unpredictably. Your tests must make the non-deterministic deterministic by controlling timing and concurrency.
Concurrency bugs hide behind success -- Most test runs pass even when race conditions exist because the default execution order happens to be safe. You must deliberately create adversarial timing conditions to surface these bugs.
State mutations are the root cause -- Every race condition involves at least two operations competing to read or write shared state. Identify the shared state first, then construct tests that exercise concurrent access paths against it.
Network latency is an amplifier, not the cause -- Slow network responses do not create race conditions; they reveal race conditions that already exist in the application logic. Simulate variable latency to expose these hidden flaws.
Reproduce before you fix -- A race condition that cannot be reliably reproduced in a test will return after the fix. Invest in building a deterministic reproduction before suggesting code changes.
Parallel user actions are the most common trigger -- Double-clicks, rapid navigation, concurrent form submissions, and multiple tabs operating on the same resource represent the highest-risk scenarios in web applications.
Test the boundaries between client and server state -- The most dangerous race conditions occur where optimistic UI updates diverge from actual server state. Test that eventual consistency is actually achieved.
Project Structure
Organize your race condition testing suite with this directory structure:
tests/
race-conditions/
double-submit.spec.ts
rapid-navigation.spec.ts
concurrent-api-calls.spec.ts
optimistic-update-conflicts.spec.ts
multi-tab-state.spec.ts
stale-closure.spec.ts
fixtures/
race-condition.fixture.ts
helpers/
timing-controller.ts
request-interceptor.ts
state-snapshot.ts
concurrency-utils.ts
reports/
race-condition-report.json
playwright.config.ts
Timing Controller
The foundation of race condition testing is the ability to control when asynchronous operations resolve. Build a timing controller that intercepts network requests and holds them until you explicitly release them.
Request Interception and Delayed Resolution
import { Page, Route } from '@playwright/test';
interface PendingRequest {
route: Route;
url: string;
method: string;
timestamp: number;
resolve: () => Promise<void>;
}
export class TimingController {
private pendingRequests: Map<string, PendingRequest[]> = new Map();
private page: Page;
constructor(page: Page) {
this.page = page;
}
async interceptRoute(urlPattern: string | RegExp): Promise<void> {
await this.page.route(urlPattern, async (route) => {
const key = this.getRouteKey(route);
const pending: PendingRequest = {
route,
url: route.request().url(),
method: route.request().method(),
timestamp: Date.now(),
resolve: async () => {
await route.continue();
},
};
if (!this.pendingRequests.has(key)) {
this.pendingRequests.set(key, []);
}
this.pendingRequests.get(key)!.push(pending);
});
}
async holdAndRelease(
urlPattern: string,
action: () => Promise<void>,
delayMs: number = 0
): Promise<void> {
await this.interceptRoute(urlPattern);
await action();
if (delayMs > 0) {
await this.page.waitForTimeout(delayMs);
}
await this.releaseAll(urlPattern);
}
async releaseAll(key?: string): Promise<void> {
if (key) {
const pending = this.pendingRequests.get(key) || [];
for (const req of pending) {
await req.resolve();
}
this.pendingRequests.delete(key);
} else {
for (const [, requests] of this.pendingRequests) {
for (const req of requests) {
await req.resolve();
}
}
this.pendingRequests.clear();
}
}
async releaseInOrder(key: string, indices: number[]): Promise<void> {
const pending = this.pendingRequests.get(key) || [];
for (const index of indices) {
if (pending[index]) {
await pending[index].resolve();
}
}
}
async releaseInReverseOrder(key: string): Promise<void> {
const pending = this.pendingRequests.get(key) || [];
for (let i = pending.length - 1; i >= 0; i--) {
await p
Установить Race Condition Finder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Race Condition Finder?
Detect and diagnose race conditions in web applications through concurrent interaction testing, state mutation analysis, and timing-sensitive scenario reproduction.
Как установить скилл Race Condition Finder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Race Condition Finder запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic