Intermittent bugs gaslight engineers: every look at the code says it's fine, and one run in twenty says otherwise. This setup investigates a flaky CI test under forensic mode: occurrence patterns treated as primary evidence (when it fails and when it doesn't is the strongest signal available), the difference hunted between failing and passing runs — timing, load, data, environment — and concurrency suspected first, per the checklist: races on shared state, timing dependencies, retry behavior, stale state, cache inconsistencies. Forensic mode matters here most: with evidence this thin, guesses are expensive.
How to use this resource
1
Log the pattern before the code
Failure rate, time of day, parallelism, data — the occurrence pattern is the dataset; collect it first.
2
Diff the runs
What is different about run 17? CI parallelism, shared state, timing — the difference IS the lead.
3
Demand a longer verification window
The contract's post-fix rule: intermittent problems need extended observation — one green run proves nothing.
Why This Works
Pattern-as-evidence framing extracts signal from a bug that hides from direct observation
The concurrency-first checklist starts where sometimes-bugs usually live
Forensic rules prevent expensive guesses when evidence is thinnest
Best for
Flaky tests that pass locally and fail in CI
Bugs that vanish when observed (and return after the standup)
Race conditions suspected but never caught
Not for
Deterministic failures — the standard strategies diagnose them faster
Fixing flaky tests by rewriting them — pin the cause first; the Test Case Prompt Generator's discipline prevents the next one
Use cases
Hunting the test that fails 5% of CI runs
Diffing failing runs against passing ones systematically
Catching the race that only fires under CI parallelism
FAQ
Why does this debugging prompt treat when the test fails as evidence instead of just reading the code?
Because the promptTemplate fixes 'Problem type: intermittent' and declares the occurrence pattern the strongest signal available, so it instructs hunting the difference between failing and passing runs across timing, load, data, and environment, and suspecting time and concurrency first per the 5-item checklist. With one failure in twenty, code-reading alone yields nothing to diff.
How do I prove the fix actually worked if the bug only shows up 5% of the time?
The template's VALIDATION REQUIREMENTS name the gold standard as a reproduction that toggles the failure on and off by toggling the suspected cause, and POST-FIX VERIFICATION demands a longer observation window because one green run proves nothing for intermittent problems. You run that validation yourself in your assistant; NewPrompt does not confirm the root cause or watch the CI window for you.
Will the debugging-prompt-generator find the root cause of my flaky OrderFlowTests failure for me?
It generates a structured diagnosis prompt built on the 10-stage framework and FACT/ASSUMPTION/HYPOTHESIS evidence labels, which you copy and run in your own ChatGPT, Claude, or Gemini. NewPrompt does not execute the investigation or guarantee the cause; the template even forbids assumptions in conclusions and requires each claim cite specific evidence, so you own the final diagnosis and fix.
"Fix this error" gets guesses. The investigation contract gets a ten-stage diagnosis: facts separated from assumptions, alternatives weighed, fixes justified.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
You click the thing twenty times, it works every time, and you close the ticket "cannot reproduce" — while it keeps happening to users. Here is how to reproduce a bug with AI: turn a vague report into conditions that make the failure appear and disappear on demand, without inventing the ones you were not given.
Software Development with AI
Tip: Save time by exploring related resources and tools that integrate with this resource.
Feedback
Send feedback to NewPrompt
Found a bug, have a suggestion, or want to report something confusing? Send a short note.
Cookie preferences
NewPrompt uses optional Google Analytics cookies to understand site usage and improve the tools.
The site works normally if you decline analytics cookies.
Read more in our Cookie Policy.