用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ChromeDevTools/devtools-frontend --skill repro-flaky-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | repro-flaky-tests |
| description | Reproduce and investigate flakiness in a test. |
This skill outlines the workflow for reproducing and fixing a flaky test in the DevTools codebase. The work should be divided into sub-agents that should only be started when certain criteria are met.
crbug.com/1234567), or a name of a test file and (optionally) the test name.I will attempt to reproduce the flakiness (simultaneously) locally and using the 'stressor bots'. Once issues are discovered, I will attempt to fix them.
First, create and start two sub-agents simultaneously. One called 'local-repro' (that should attempt to reproduce the problem locally) and one called 'bot-repro' (that attempts to use the stressor bots to reproduce).
npm run test -- --repeat=<count> path/to/foo.test.ts:exact_test_id to locally run the tests repeatedly. Both E2E and unit tests support this. Use the exact test ID printed in the test runner output (usually the suite and test names with spaces replaced by underscores). Do not use --grep or a bash script with a for loop.Test: Runs Sec Failures
"Recorder/should be able to start a replay..." 30 180 0 (0.00%)
"The Debugger Language Plugins/shows sensible..." 60 180 1 (1.67%)
If problems were detected, list the different problems found and how often they occurred. Ask the user if the errors match the ones they are trying to get rid of.
The second bot should do the following:
Create a branch with a meaningful name, such as deflake_<test_name>.
Ensure you use the instructions from the devtools-version-control skill to create and switch branches appropriately.
Make a minor, harmless modification directly to the test file being investigated (e.g., adding a comment // Trigger stressor bot) to ensure the commit is not empty.
Add this file (with git add) and commit it using a meaningful commit message (e.g., git commit -m "Deflake <test name>"). Ask the user which bug number to use for the changelist description.
Upload this change using git cl upload -f. Always use -f (--force) so the upload runs non-interactively without opening a text editor or prompt. This creates a debugging CL that all agents (like the fix agent) will continue to work on.
Note the created during upload.
To start the stressor bot, run this command (substituting <test file>:exact_test_id with the actual file and exact test ID):
git cl try -B devtools-frontend/try -b e2e_stressor_linux -b e2e_stressor_win64 -b e2e_stressor_mac -p runner_args='<test file>:exact_test_id --repeat=100'
assertScreenshot), it should ONLY be run on the Linux stressor bot (-b e2e_stressor_linux), because screenshot assertions are not supported on Mac or Windows. Furthermore, they cannot be reproduced locally on a Mac.git cl try fails with a login error (e.g., Login required: run bb auth-login), inform the user so they can resolve the auth issue and ask you to retry.Note that the test file name needs to be relative to the root, so use test/e2e/foo.test.ts instead of e2e/foo.test.ts.
Check the results of the stressor tests with git cl try-results --issue=<issue number> --patchset=<patchset number>. You can dive into each result by id using bb get <id>.
Once a test run completes, always report to the user how often the tests ran and what the failure rate was.
Critical: Make sure that at least one test ran to completion on the bot (to catch incorrect syntax for or incorrect test IDs).
While we wait for the bots to complete their run, would you like to:
1) Continue trying to reproduce locally
2) Start investigating the test
If they opt for investigating the test, start a new agent called 'fix-test'.
The test fixing sub-agent should do the following:
git cl upload -f.git cl try