How to Handle Flaky Automated Tests That Slow Down Our Deployment Pipeline?

December 28, 2025 6 answers
Asked by off-season-training
We're struggling with our testing pipeline which is bogging down our productivity. We have a Selenium test suite with around 650 tests that runs on every pull request, averaging about 40 minutes per run, but it sometimes takes an hour. The biggest issue is flakinessโ€”about 8 to 12 tests fail on each run, always different ones. Our developers have resorted to simply clicking 'rerun' and grabbing coffee while they wait.

Answers

calculus clinic
It sounds like the existing strategy might not be optimal for your project. Instead of running all tests on every PR, consider running only a subset of key tests. This way, you're getting feedback quicker and can avoid the bottleneck while still maintaining quality.

yield_92pct: Totally! Targeting critical paths can reduce the load while still ensuring quality.

Reply to this answer
shoelace aglet
Budget could also play a role here. If you're running tests on slow machines, it might be worth talking to management about investing in better resources. Good hardware can make a huge difference in speed and reliability, especially when running tests in parallel.

!wash separately: True! But it'll only work if the management sees the value in speeding things up.

Reply to this answer
!confetti cleanup
What about enabling auto-retries for those flaky tests? It could save some hassle while you're working on making the tests more stable. Sometimes just a little tweak like that can help mitigate the pain temporarily.
Reply to this answer
!sift.once
You might need to tackle the flakiness directly. Are your tests designed to handle asynchronous actions properly? If they arenโ€™t, that can lead to unreliable results. Switching to a more robust framework like Cypress could potentially solve some of these issues too.
Reply to this answer
civic access
Have you checked how many of those 650 tests are actually necessary? It's worth reviewing each one to see if they're still relevant or if any can be removed. You might find a lot of old tests that donโ€™t apply anymore which could clear up some of the noise.
Reply to this answer
sugar-free-gum
Sounds like you're in a tough spot! One big factor could be management's mindset. If they're pushing for constant shipping with flaky tests, itโ€™s time to have a serious talk. In my experience, management needs to acknowledge that if the pipeline is failing often, itโ€™s dragging down overall morale. That said, you might consider temporarily disabling some of those flaky E2E tests while you fix the underlying issues, especially if they arenโ€™t catching real bugs.

Old.Map.Reader: Exactly! If the tests arenโ€™t reliable, they become a bigger problem than just running them. Management needs to take notice of the productivity drop.

!all clear: Agreed, itโ€™s crucial to put focus where itโ€™s needed! You can't keep shipping flawed code just for the sake of speed.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions