3 tips for stopping flaky tests

Google for Developers · Intermediate ·📰 AI News & Updates ·2mo ago
Skills: ML Pipelines90%

Key Takeaways

Tips for stopping flaky tests in CI builds

Full Transcript

Flaky tests are the worst. Is your CI build failing again because of a test that only sometimes works? To maintain a high-quality codebase, you need reliable signals. Here are three quick tips [music] to stop flaky tests from wasting your time. Number one, isolate [music] your state. If your tests write to hard-coded file paths or shared databases, concurrent runs will collide. Use unique, temporary environments for every single run. Number two, take out your external dependencies. Disk I/O and network calls introduce randomness. Swap them out [music] with test fake to make your unit tests lightning fast and strictly deterministic. Number three, check your assumptions. Don't assume your test environment starts perfectly clean. Explicitly clear out existing data before executing. Stop ignoring red builds. Subscribe to Google for Developers for more testing tips.

Original Description

We have all been there: your CI build fails yet again because of a test that doesn't consistently work. In this video, we explore three tips to stopping flaky tests in their tracks. From isolating your states to fixing internal dependencies, see how these tips can help you achieve a high quality code base with reliable signals. Subscribe to Google for Developers → https://goo.gle/developers Speakers: Marily Nika
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
NRED Is Moving From Target Generation to Operational Intelligence
NRED shifts focus from target generation to operational intelligence, leveraging MetalCore and EyeX platforms
Medium · AI
📰
The top AI fear for 6,000 tech pros isn't losing their jobs - it's more work for the same pay
Tech pros fear increased workload due to AI, not job loss, and are hesitant to recommend their role to newcomers
ZDNet
📰
Only10 Vol.26.01 | 10 AI Projects Worth Watching This Week
Discover 10 noteworthy AI projects using the CRP framework to stay updated on the latest developments in the field
Medium · ChatGPT
📰
Top 10 AI Development Companies in the USA (2026 Edition)
Discover the top 10 AI development companies in the USA to learn about industry leaders and potential partners or employers
Medium · AI
Up next
The LATEST Facebook Ads Tutorial For Beginners in 2025 | Step-By Step Guide
Christian Omeje - UDH
Watch →