Playwright + Python · Lesson 35 of 37
Module 35: Retries & Flaky Tests
Your task
Implement is_retryable_error_message(err_msg: str) -> bool:
Write it in the editor, then press Check answer (Ctrl + Enter).
# Re-run failed tests up to 2 times:
pytest --reruns 2 --reruns-delay 1page.expect_response() instead of waiting for DOM side effects.Flaky tests erode team confidence. In this lesson, we examine the root causes of test flakiness: shared test data, order dependency, and timing issues. You will configure automated retries with pytest-rerunfailures and diagnose root causes. Let's make tests rock-solid!
Part of the Playwright + Python course (Playwright with Python). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
No. Retries are a safety net for transient network blips on CI. The underlying flakiness must still be investigated and resolved using Trace Viewer.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___