mejbaurbahar/software-tester-skills/concurrency-race-condition-testing
Claude Code and agent skill by mejbaurbahar/software-tester-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when testing thread-safety, race conditions, deadlocks, double-submit, idempotency, optimistic/pessimistic locking, async ordering bugs, and flaky concurrency failures — with TSan, go -race, stress loops, barrier-based harnesses and parallel API calls.
Install
npx vskill@latest install mejbaurbahar/software-tester-skills/concurrency-race-condition-testingSKILL.md
Concurrency & Race-Condition Testing
Races don't fail on demand. You must force interleavings and detect violations.
Bug catalog (what to hunt)
Lost update (read-modify-write) · double spend / oversell (check-then-act) · duplicate submit / retry storms · deadlock (lock ordering) · livelock/starvation · stale cache after write · non-atomic multi-step DB ops · async callbacks out of order · TOCTOU file/permission checks · unsafe shared state in singletons · connection/thread-pool exhaustion.
Detection tools
| Stack | Tool | |
|---|---|---|
| Go | go test -race -count=100 ./... | |
| C/C++/Rust | ThreadSanitizer (-fsanitize=thread), loom (Rust) | |
| Java | jcstress, -XX:+..., Thread dumps, jstack deadlock detection | |
| Python | pytest-xdist, threading.Barrier, asyncio.gather stress | |
| JS/TS | Promise.all bursts, jest --runInBand vs parallel diff | |
| DB | Two sessions + pg_sleep/SLEEP() to widen windows; isolation-level tests | |
| System | stress-ng, k6/Locust with identical concurrent requests |
Force the interleaving
What to assert
- Exactly-once: inventory never < 0; balance conserved; one row per idempotency key; unique constraints hold.
- Isolation: no dirty/non-repeatable/phantom reads at the level you claim (
READ COMMITTEDvsSERIALIZABLE). - Liveness: operations finish under contention (timeouts, no deadlock); lock timeouts surface clean errors.
- Ordering: events processed in key order; consumers tolerate redelivery.
Fix patterns to recommend
Atomic SQL (UPDATE … SET qty = qty-1 WHERE qty>0) · optimistic locking (version column/ETag If-Match) · unique constraints + idempotency keys · advisory locks/SELECT … FOR UPDATE · consistent lock ordering · queue partitioning by key · immutable data.
Reporting
Include seed/iteration count, concurrency level, exact interleaving/log lines, and expected vs observed invariant. Rate by blast radius (money/data loss = Sev1).
Related
api-testing, database-testing, flaky-test-management, chaos-resilience-testing, event-driven-messaging-testing
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/concurrency-race-condition-testing/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mejbaurbahar/software-tester-skills/concurrency-race-condition-testing)