{
  "id": 11970365,
  "title": "Playwright Retry Budgets Need a Failure Receipt",
  "url": "https://urgent.news/2026/10/04/playwright-retry-budgets-need-a-failure-receipt",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-04T17:23:51.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/silviutech/playwright-retry-budgets-need-a-failure-receipt-3j5f"
  },
  "original_language": "en",
  "account": "Retries are helpful for temporary network issues in browser tests, but they become problematic when every failure results in additional attempts without documenting the issue. A retry can transform a clear defect into a green build that nobody trusts. For Playwright suites, a small retry budget and consistent failure receipt prove more useful than unlimited patience. The aim is not to remove retries entirely, but to make each retry explain itself. Unlimited retries can cause complications when multiple systems are involved, such as the browser, application API, and email provider. A generic retry setting of 2 does not indicate which component is unstable. Moreover, retries can increase side effects. A test that sends an invitation, creates a payment intent, or uses a one-time token should not be automatically repeatable. Before increasing retries, consider whether the operation is idempotent and whether cleanup is performed after a failed attempt. If not, the retry may be running a second experiment with different data, rather than repeating the original test. To create a retry budget per failure class, begin with a simple classification: browser timing, external dependencies, product assertions, and test isolation. This approach treats the budget as a diagnostic decision rather than a free pass for retries. A flaky locator may need one controlled retry, while a failed business assertion should generate an immediate failure receipt. It's essential to maintain an honest test report, where a passing retry indicates instability, not that the scenario is healthy. Capture a useful failure receipt for each attempt, containing information such as the test, attempt number, last meaningful application event, fixture ID, relevant artifacts, and whether the retry is retryable. Redact sensitive information from the receipt, such as inbox passwords or verification tokens. A compact pattern for attaching a receipt after a failure in Playwright involves extending the test runner and using the testInfo object to create a receipt JSON. Implement a modest global retry count, with a higher value only for tests with a documented reason. Review the receipt before examining the final assertion to identify the root cause of the failure. Classify assertion failures separately from dependency timeouts and ensure cleanup is idempotent and safe to run after partial setup.",
  "summary": "Retries are useful when a browser test meets a temporary network problem. They become harmful when every failure gets three more attempts with no record of what happened. A retry can turn one actionable defect into a green build that nobody trusts. For Playwright suites, I find a small retry budget and a consistent failure receipt much more useful than unlimited patience. The goal is not to…",
  "key_points": [
    "Implement a small retry budget for Playwright suites",
    "Create a failure receipt with test, attempt, and relevant artifacts",
    "Classify assertion failures separately from dependency timeouts"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}