Find the cause of a flaky test or intermittent bug
Systematically narrow down why a test or bug only fails sometimes, with experiments to prove the cause.
Find why a build or pipeline fails in CI but not locally, and get the exact change to fix it.
My CI pipeline is failing. Help me find the cause and the fix.
CI system: {{ci}}
Project type and stack: {{stack}}
Does it pass locally?: {{local}}
What changed since the last green run: {{changes}}
Pipeline config:
{{config}}
Log output around the failure (include some lines before the first error):
{{log}}
Please:
1. Find the first real error in the log, ignoring the cascade of follow-on errors, and quote it. Say which step failed and why.
2. List the plausible causes ranked, considering differences between my machine and CI: clean checkout, cached dependencies, tool and OS versions, environment variables and secrets, file permissions and case sensitivity, available memory and time limits, network access, and test ordering.
3. For the top cause, give the exact config or code change as a diff, and a way to reproduce it locally (for example a container command that mimics the CI image).
4. Suggest how to confirm the fix without waiting for many full runs.
5. Point out any unrelated problems in the config that I should fix: missing cache keys, unpinned versions, steps that run twice, or unnecessary privileges.
If the log is cut off or the cause is ambiguous, tell me exactly what to add to the log or which debug flag to turn on.Ranking differences between your machine and CI covers most real-world causes, and the container reproduction command saves many push-and-wait cycles. Paste more context lines for a surer diagnosis.
Licensed CC0 (public domain) Version 1 · history
Systematically narrow down why a test or bug only fails sometimes, with experiments to prove the cause.
Create a PR description that helps reviewers understand the change, how to test it and what to watch for.
Turn a diff or a rough description into a clean commit message that explains the why, not just the what.
Plan a database, framework or infrastructure migration with phases, rollback points and verification at each step.
Turn an error message and stack trace into ranked root-cause hypotheses, quick checks to confirm each, and a fix.
Turn vague customer descriptions into a structured bug report with severity, reproduction steps, likely area and missing information.
Comments (0)
Sign in to join the discussion.
No comments yet. Be the first to share how it worked.