reproduce-ci-flakiness
Skill739 starsChanged 7 days agoApache-2.0View on GitHub
Reproduce timing-sensitive dd-trace-java CI test failures locally using bounded reruns, interpreted JVM execution (-Xint), and reduced CPU availability. Use for intermittent timeouts, asynchronous assertions, races, and tests that pass locally but fail in CI. Excludes muzzle compatibility failures and CI retry/history analysis alone.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-logic/AGENTS.mdAGENTS.md
- buildSrc/AGENTS.mdAGENTS.md
- build-logic/CLAUDE.mdCLAUDE.md
- buildSrc/CLAUDE.mdCLAUDE.md
- .claude/CLAUDE.mdCLAUDE.md
- apm-integrationsSkill
- clarify-java-commentsSkill
- fix-continuation-leakageSkill
- java-lintSkill
- migrate-groovy-to-javaSkill
- migrate-junit-source-to-tabletestSkill
- perf-reviewSkill
- resolve-muzzle-ciSkill
- review-groovy-migrationSkill
- techdebtSkill
- fix-continuation-leakageSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 12
Read the reproduction guide before running experiments.
- Very specific: line 25
Run the narrowest matching test with the CI JDK and dependencies before adding stress.
- Very specific: line 28
Remove skipFlakyTests when targeting an annotated test.
- Very specific: line 37
Run a small matrix: baseline, -XX:ActiveProcessorCount=2 (then 1 if useful), -Xint, then both together.
- Very specific: line 43
Use the guide's command-scoped JAVA_TOOL_OPTIONS recipe and verify the failing JVM receives the flags.
- Very specific: line 61
Keep the first matching failure's log and JUnit XML/HTML before another invocation overwrites them.
- Distinctive: line 68
Do not retry remote CI, quarantine tests, increase timeouts, or change production code merely to make reproduction green.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Reproduce CI flakiness
Read the reproduction guide before running experiments. It contains the commands, flag scopes, and evidence checklist. The goal is a small local reproducer with the same failure as CI, not merely any failure under load.
Establish the target
- Extract the commit, full Gradle task path, test class/method, first causal failure,
JDK version/vendor, architecture, and relevant services from the CI log or artifacts.
Inspect the module's build file for the actual suite and JVM constraints. Distinguish
test,forkedTest,latestDepTest, and custom suites; do not guess a task from the class name. - Retrieve CI logs and artifacts using available authenticated tools and the repository's documented access guidance. If access is unavailable, ask for the relevant failure log or artifacts. Never request or print access tokens.
- Run the narrowest matching test with the CI JDK and dependencies before adding stress.
Preserve CI's exact
testJvmselector and Gradle concurrency settings in the baseline; useJAVA_<selector>_HOMEto point a named selector at the matching local JDK. RemoveskipFlakyTestswhen targeting an annotated test. UserunFlakyTestsonly when intentionally selecting annotated tests. Confirm the test actually executes rather than being skipped, filtered out, up to date, or restored from cache. - Separate dependency resolution, missing services, unsupported JVM flags, and compilation
failures from test failures. Route muzzle failures to
resolve-muzzle-ci; route continuation lifecycle diagnostics tofix-continuation-leakageafter preserving the reproduction evidence.
Perturb timing deliberately
Run a small matrix: baseline, -XX:ActiveProcessorCount=2 (then 1 if useful), -Xint,
then both together. Change one factor at a time and record results per profile. Start with
one attempt per profile; repeat a promising profile up to ten times, with an overall time
budget stated before execution (default 15 minutes). Stop at the first matching failure or
the budget. Do not start another attempt when the remaining budget cannot accommodate it.
Use the guide's command-scoped JAVA_TOOL_OPTIONS recipe and verify the failing JVM receives
the flags. This also slows newly launched build JVMs and inherited child processes. If that
prevents useful experiments, use a temporary init script to scope jvmArgs to the selected
Gradle Test task, and verify child JVMs separately. Do not commit diagnostic settings or
change global Gradle/JDK configuration.
ActiveProcessorCount changes JVM-visible CPU count and pool sizing; it is not a CPU quota.
--max-workers limits Gradle work, not application threads. If CI starvation is the suspected
cause, use an existing suitable Linux/container environment with a CPU quota or affinity,
recording that as a separate experiment. Reducing Gradle workers can hide contention, so
keep CI's concurrency in the baseline and treat serialized execution as a separate profile.
-Xint removes JIT compilation and can hide compiler-dependent races or cause unrelated
timeouts. A different failure is a new observation, not a successful reproduction. Keep a
normal-JIT comparison; passing stress runs do not establish that a test is reliable.
Preserve and report
Keep the first matching failure's log and JUnit XML/HTML before another invocation overwrites them. Report the exact command and environment, test/JDK/commit, attempts and failures per profile, elapsed time, report paths, and whether the signature matches CI. A build failure or zero executed tests is not a passing attempt.
For hangs, capture thread dumps from the test worker and relevant child JVMs before terminating them. Do not leave detached retry loops or test processes running when the investigation ends. Do not retry remote CI, quarantine tests, increase timeouts, or change production code merely to make reproduction green. Fix requests may proceed to a causal fix; reproduction-only requests end with evidence and a hypothesis. Validate any subsequent fix under both the reproducing profile and normal execution.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

