test-flakiness
Skill này làm gì
Skill này xem kết quả kiểm thử tự động qua nhiều lần chạy và tìm các kiểm thử thất bại ngẫu nhiên. Skill dành cho lập trình viên và trưởng nhóm QA đã mệt mỏi vì các bản build đỏ không đáng tin.
Khi nào nên dùng
- ✓Khi một nhóm có nhiều lần chạy kiểm thử và nghi ngờ một số kiểm thử thất bại ngẫu nhiên.
- ✓Khi lập trình viên bắt đầu cho rằng lỗi CI có lẽ không ổn định và bỏ qua chúng.
- ✓Khi các kiểm thử đã bị cách ly cần được chẩn đoán nguyên nhân có thể.
Liên kết skill
https://github.com/Donchitos/Claude-Code-Game-Studios/blob/main/.claude/skills/test-flakiness/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy xem log CI của chúng tôi, tìm kiểm thử nào không ổn định và cho tôi biết kiểm thử nào nên cách ly.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đọc các tệp log CI, tính tỷ lệ qua trên các lần chạy và phát hiện những lỗi không liên tục. Skill đề xuất nên cách ly hay sửa từng kiểm thử không ổn định và có thể lưu báo cáo.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
!bash "${CLAUDE_SKILL_DIR}/../../hooks/yaml-helper.sh" resolve_config --keys automation
Automation mode: Resolve modes.automation (project.local.yaml →
project.yaml → default collaborative). Every AskUserQuestion call and
every file write follows .claude/docs/automation-modes.md
(collaborative asks always · guided major-only · autonomous logs and proceeds;
automation_always_ask categories always prompt).
Test Flakiness Detection
A flaky test is one that sometimes passes and sometimes fails without any code change. Flaky tests are worse than no tests in some ways — they train the team to ignore red CI runs, masking genuine failures. This skill identifies them, explains likely causes, and recommends whether to quarantine or fix each one.
Output: Updated tests/regression-suite.md quarantine section + optional
production/qa/flakiness-report-[date].md
When to run:
- Polish phase (tests have had many runs; statistical signal is reliable)
- When developers start dismissing CI failures as "probably flaky"
- After
/regression-suiteidentifies quarantined tests that need diagnosis
1. Parse Arguments
Modes:
/test-flakiness [ci-log-path]— analyse a specific CI run log file/test-flakiness scan— scan all available CI logs in.github/or standard log output directories/test-flakiness registry— read existing regression-suite.md quarantine section and provide remediation guidance for already-known flaky tests- No argument — auto-detect: run
scanif CI logs are accessible, elseregistry
2. Locate CI Log Data
Option A — GitHub Actions (preferred)
Check for test result artifacts:
ls -t .github/ 2>/dev/null
ls -t test-results/ 2>/dev/null
For Godot projects: GdUnit4 outputs XML results compatible with JUnit format,
under reports/ (its default report folder, res://reports/). Check reports/,
and any test-results/ you saved runs into, for .xml files.
For Unity projects: game-ci test runner outputs NUnit XML to test-results/
by default.
For Unreal projects: automation logs go to Saved/Logs/. Grep for
Result={Success} and Result={Fail} — each test prints
Test Completed. Result={<status>}
(docs/engine-reference/unreal/current-best-practices.md, "Command Line").
Option B — Local log files
If a path argument is provided, read that file directly.
Option C — No log data available
If no logs found:
"No CI log data found. To detect flaky tests, this skill needs test result history from multiple runs. Options:
- Run the test suite at least 3 times and collect the output logs
- Check CI pipeline output and save a log to
test-results/- Run
/test-flakiness registryto review tests already flagged as flaky intests/regression-suite.md"
Stop and ask the user which option to pursue.
3. Parse Test Results
For each CI log or result file found, parse:
JUnit XML format (GdUnit4):
- Grep for
<testcase name=to get test names - Grep for
<failureor<errorto identify failures - Parse
classnameandnameattributes for full test identifiers
NUnit XML format (Unity — the file whose <test-run> element /smoke-check
reads):
- Each test is a
<test-caseelement; itsfullnameattribute is the identifier - Its
resultattribute isPassed,Failed,InconclusiveorSkipped(docs/engine-reference/unity/current-best-practices.md, "Command Line"); onlyPassedandFailedenter the history
Plain text logs:
- Grep for pass/fail patterns:
- Godot:
PASSED/FAILEDadjacent to test names - Unreal:
Result={Success}/Result={Fail} - Unity:
Test passed/Test failed
- Godot:
Build a table: test_id → [run1_result, run2_result, run3_result, ...]
4. Identify Flaky Tests
A test is flaky if it appears in the result history with both PASS and FAIL outcomes across runs with no code changes between them.
Flakiness thresholds:
- High flakiness: Fails in >25% of runs — quarantine immediately
- Moderate flakiness: Fails in 5–25% of runs — investigate and fix soon
- Low/suspected flakiness: Fails in 1–5% of runs — monitor; may be genuinely rare failure
With fewer than 3 runs, every finding is suspected, whatever its fail rate. One failure in two runs reads as 50%, but it is one data point: do not quarantine it, label it suspected, and ask whether more run data is available. The tiers above, and quarantine, apply from
Câu hỏi thường gặp
Skill có cần nhiều lần chạy không?
Có. Skill hoạt động tốt nhất sau nhiều lần chạy, vì một lần chạy không thể cho thấy lỗi không liên tục.
Cách ly nghĩa là gì?
Đó là đưa một kiểm thử không ổn định ra khỏi kết quả chính để nó không che giấu các lỗi thật.
Skill tìm log ở đâu?
Nó có thể phân tích một tệp log bạn chỉ định, hoặc quét các thư mục log CI tiêu chuẩn.
Chi tiết
Mô tả gốc của tác giả
Find flaky tests from CI logs — aggregates pass rates, spots intermittent failures, recommends quarantine. After multiple runs.
Độ phổ biến
- Sao GitHub
- 33k
- Vị trí xếp hạng
- #8502
- Giấy phép
- MIT
- Cập nhật
- 18/10/2026
Bình luận
- …
Thêm skill từ kho mã này
adopt
33kKiểm tra xem tài liệu của một dự án game hiện có có tuân theo định dạng của mẫu studio hay không, rồi viết một kế hoạch di chuyển có đánh số để sửa các khoảng trống.
architecture-decision
33kViết một bản ghi quyết định kiến trúc cho một lựa chọn kỹ thuật, gồm bối cảnh, các phương án thay thế và hệ quả, với xem xét từ các vai trò kỹ thuật phù hợp.
architecture-review
33kKiểm tra các quyết định kỹ thuật của bạn có bao phủ mọi yêu cầu thiết kế, không mâu thuẫn và phù hợp với phiên bản động cơ, với kết luận đạt hoặc có mối lo ngại rõ ràng.
art-bible
33kViết một art bible xác định bản sắc thị giác của game, để việc sản xuất tài nguyên tuân theo một bộ quy tắc phong cách rõ ràng.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.