brave/check-upstream-flake
"Check if a failing test is a known upstream flake in Chromium's LUCI Analysis database. Provides flakiness statistics, verdict, and recommendation for upstream, check luci flakiness, upstream flake check."
npx skills add https://github.com/brave/brave-core --skill check-upstream-flake
Check if a failing test is a known upstream flake in the Chromium LUCI Analysis
database. This queries the REST API at analysis.api.luci.app to retrieve
historical pass/fail/flake data for a test in the Chromium CI infrastructure.
When invoked with a test name:
# Basic: check a specific test (default 30-day lookback)
python3 ./script/check-upstream-flake.py "WebUIURLLoaderFactoryTest.RangeRequest"
# Longer lookback window
python3 ./script/check-upstream-flake.py "WebUIURLLoaderFactoryTest.RangeRequest" --days 60
# JSON output (for programmatic use)
python3 ./script/check-upstream-flake.py "WebUIURLLoaderFactoryTest.RangeRequest" --json
# Search by test class name (finds all methods)
python3 ./script/check-upstream-flake.py "WebUIURLLoaderFactoryTest"
Arguments:
test_name (required): Test name or substring to search for--days N: Lookback window in days (default: 30, max: 90)--json: Output JSON instead of markdownExit codes:
0: Success (results found and reported)1: Error (network, API, etc.)2: No matching test IDs foundThe script produces one of five verdicts:
| Verdict | Flake Rate | Action |
| -------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| Known upstream flake | >= 5% | Safe to add to filter file. Document upstream flakiness in the filter comment. |
| Occasional upstream failures | 1-5% | Consider filtering. Document findings. May still warrant investigation. |
| Stable upstream | < 1% | Investigate Brave-specific causes. The test is stable in Chromium, so Brave code changes are likely causing the failure. |
| Insufficient data | N/A (<10 verdicts) | Cannot determine from upstream data. Manual investigation needed. |
| Not found | N/A | Test not in Chromium database. May be Brave-specific or use a different ID format. |
Flake rate is calculated as (failed + flaky) / (passed + failed + flaky).
Skipped and precluded verdicts are excluded from the rate.
days per LUCI Analysis)"
brave/chromium_src/ overrides in related directoriesThe script uses the LUCI Analysis REST API (pRPC protocol):
POST https://analysis.api.luci.app/prpc/luci.analysis.v1.TestHistory/QueryTests
POST https://analysis.api.luci.app/prpc/luci.analysis.v1.TestHistory/QueryStats
POST https://analysis.api.luci.app/prpc/luci.analysis.v1.TestHistory/Query
No authentication is required for public Chromium data.
Test IDs in LUCI follow the format:
ninja://{gn_path}:{target}/{TestSuite}.{TestMethod}
Take brave/check-upstream-flake from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.