Weekly
Get the week's flaky tests on Friday
Each Friday you get the tests CircleCI has marked as flaky, so someone can fix them.
- Runs
- Weekly
- Apps
- CircleCI
- AI
- Not needed
- Access
- read
Send this to your assistant
Create a ClickRuntime automation: every Friday at 3pm, email me the flaky tests CircleCI has found in my acme/web-app project, with the job each one runs in.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A flaky test is worse than a failing one. It passes on the second attempt, so nobody fixes it, yet it wastes a few minutes on every unlucky run and teaches developers to ignore red builds. Across a team of twenty, that habit turns into hours of reruns and, eventually, a real regression that gets dismissed as flakiness.
Every week, this asks CircleCI for the tests it has identified as flaky and emails the list. Each entry names the test and how often it flipped between pass and fail, so the people who own the suite can see which ones to repair.
Teams with large end-to-end or integration suites benefit most, because that is where nondeterministic tests accumulate unnoticed. The list comes from CircleCI's own test insights, so it reflects the real pass and fail history on your code rather than a guess from the automation.
What you get out of it
Stop developers dismissing red builds
When a flaky test is known and listed, a failed run still deserves attention. Trust in CI stays high, and an actual bug is less likely to be waved off as another flake.
Reclaim minutes lost on reruns
Each unnecessary rerun can cost ten to twenty minutes of waiting. A weekly list of the offenders lets the team remove them one by one and give that time back across every developer.
Assign owners with a clear list
A named list of tests is easy to hand out in a team meeting. Each person takes one or two, and the next week's email shows whether they dropped off. Ownership removes the bystander effect that lets flaky tests linger for years while everyone assumes somebody else will deal with them.
Expose slow-burning test debt
Flaky tests accumulate slowly. Seeing the list grow from five entries to fifteen is an early signal to pause feature work and spend a sprint on test reliability. A short list is a good sign and a long list is a budget request, so the email doubles as a health indicator for the suite.
Support the case for refactoring
When you ask for time to stabilize a test suite, a dated list of specific tests is far more persuasive than a general complaint that CI feels unreliable. The evidence also makes the cleanup easier to schedule, because you can point at specific tests instead of a vague feeling.
How it works
What happens, step by step
Every Friday, ClickRuntime asks CircleCI which tests it has marked as flaky.
It lists each test with the job it runs in and how many times it flaked.
You get one email with the list, so someone can pick them up and fix them.
Before it runs live
- Connect CircleCI
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other CircleCI steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, notify
PROJECT = "gh/acme/web-app"
@on_trigger
def run(event):
resp = http.get(f"https://circleci.com/api/v2/insights/{PROJECT}/flaky-tests",
headers={"Circle-Token": credentials.secret("CIRCLECI_TOKEN")})
resp.raise_for_status()
tests = sorted(resp.json()["flaky_tests"], key=lambda t: -t["times_flaked"])
lines = [f"{t['test_name']} ({t['classname']}) in job {t['job_name']}: flaked {t['times_flaked']}x"
for t in tests]
notify.email_me(f"{len(tests)} flaky tests in {PROJECT}", "\n".join(lines) or "No flaky tests found.")
return {"flaky": len(tests)}FAQ
Common questions
How does CircleCI decide a test is flaky?
Do I need to upload test results to CircleCI?
Can the list go to Slack as well as email?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a weekly build health report
Every Monday you see each workflow's success rate and typical duration for the past week.
See how it worksSee yesterday's failures on main each morning
One email each morning lists the workflows on main that failed the day before, with links, and needs no webhook.
See how it worksFind the jobs that got slower this week
Each week you see which jobs in a workflow got slower or less reliable compared with the week before.
See how it worksKeep exploring
Set up “Get the week's flaky tests on Friday” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.