Test Automation Engineer study guide
Flaky Tests: Causes and Mitigation
A Flaky Test is an automated script that sporadically passes and fails across multiple runs without any changes to the SUT code or the test code. They destroy trust in the automation suite and cause alert fatigue among developers.
Practical example
Common causes of flakiness: Race Conditions: The script clicks a button before the JavaScript has finished rendering it (Timing issues). Environment Instability: Network timeouts or third-party API rate limits. Test Data Collisions: Two parallel tests trying to modify the exact same user record in the database simultaneously.
Exam scenario and common trap
Question: What is the best initial mitigation strategy when a test is identified as flaky? The Trap: "Add an automatic retry loop (e.g., run it 3 times until it passes)." The Correct Answer: Quarantine (disable) the test immediately so it stops blocking the CI/CD pipeline, then investigate the root cause. Auto-retries mask the underlying race condition and make the pipeline slower.
Related syllabus material covers the broader concept; this page includes additional context. Reference sections: 4.3.1, 7.1.3. See the official ISTQB syllabus for exam scope. Examples are independent; QA-ace is not affiliated with ISTQB.