{
  "format": 3,
  "id": "4.4",
  "title": "Retries, serial suites and separate repeatEach tests",
  "layers": {
    "runner": {
      "label": "Runner"
    },
    "app": {
      "label": "App"
    },
    "fail": {
      "label": "Fail"
    },
    "test": {
      "label": "Test"
    }
  },
  "lanes": {
    "runner": {
      "label": "RUNNER",
      "layer": "runner",
      "y": 16,
      "h": 425.20000000000005,
      "x": 16,
      "w": 652.278
    },
    "worker": {
      "label": "WORKER PROCESS",
      "layer": "runner",
      "y": 469.20000000000005,
      "h": 601.8,
      "x": 16,
      "w": 652.278
    }
  },
  "frames": {
    "serialQualification": {
      "label": "RESULT-ROW ARROWS · SERIAL ONLY",
      "showWith": [
        "copies"
      ],
      "box": [
        39.333333333333314,
        188.6,
        239.48099999999988,
        76
      ]
    }
  },
  "nodes": {
    "budget": {
      "label": "Retry budget · one test",
      "layer": "runner",
      "lane": "runner",
      "box": [
        270.8333333333333,
        40,
        170,
        36
      ]
    },
    "copies": {
      "label": "repeatEach copies",
      "layer": "runner",
      "lane": "runner",
      "box": [
        51.333333333333314,
        216.6,
        140,
        36
      ]
    },
    "collect": {
      "label": "Collect entire serial suite",
      "layer": "runner",
      "lane": "runner",
      "box": [
        223.33333333333331,
        216.6,
        180,
        36
      ]
    },
    "outcome": {
      "label": "Classify all results",
      "layer": "runner",
      "lane": "runner",
      "box": [
        55.83333333333333,
        393.20000000000005,
        137,
        36
      ]
    },
    "dispatch": {
      "label": "Dispatcher · worker jobs",
      "layer": "runner",
      "lane": "runner",
      "box": [
        224.83333333333331,
        393.20000000000005,
        177,
        36
      ]
    },
    "first": {
      "label": "Earlier pass",
      "layer": "app",
      "lane": "worker",
      "box": [
        532.278,
        493.20000000000005,
        124,
        36
      ]
    },
    "failed": {
      "label": "Unexpected",
      "layer": "fail",
      "lane": "worker",
      "fail": true,
      "box": [
        536.778,
        669.8000000000001,
        115,
        36
      ]
    },
    "later": {
      "label": "Later test",
      "layer": "app",
      "lane": "worker",
      "box": [
        513.1113333333333,
        846.4000000000001,
        124,
        36
      ]
    },
    "stop": {
      "label": "Worker 1 stops",
      "layer": "runner",
      "lane": "worker",
      "box": [
        515.6113333333333,
        1023.0000000000001,
        119,
        36
      ]
    },
    "fresh": {
      "label": "Fresh worker 2",
      "layer": "runner",
      "lane": "worker",
      "box": [
        254.33333333333331,
        493.20000000000005,
        118,
        36
      ]
    },
    "retry": {
      "label": "Retry body · same test / whole serial suite",
      "layer": "app",
      "lane": "worker",
      "box": [
        28,
        669.8000000000001,
        289,
        36
      ]
    }
  },
  "edges": {
    "first_failed": {
      "from": "first",
      "to": "failed",
      "label": {
        "at": [
          522.747,
          603.7
        ],
        "text": "serial only"
      },
      "path": "M594.278,529.2 L594.278,669.8000000000001",
      "badge": [
        594.278,
        617.075
      ]
    },
    "failed_later": {
      "from": "failed",
      "to": "later",
      "label": {
        "at": [
          503.58033333333333,
          780.3000000000001
        ],
        "text": "serial only"
      },
      "path": "M575.1113333333333,705.8000000000001 L575.1113333333333,846.4000000000001",
      "badge": [
        575.1113333333333,
        793.6750000000001
      ]
    },
    "failed_stop": {
      "from": "failed",
      "to": "stop",
      "label": {
        "at": [
          672.1113333333333,
          868.6000000000001
        ],
        "text": "failure"
      },
      "path": "M613.4446666666665,705.8000000000001 L613.4446666666665,715.8000000000001 L669.1113333333333,715.8000000000001 L669.1113333333333,969.0000000000001 L604.8613333333333,969.0000000000001 L604.8613333333333,1023.0000000000001",
      "badge": [
        669.1113333333333,
        881.9625000000001
      ]
    },
    "stop_budget": {
      "from": "stop",
      "to": "budget",
      "path": "M545.3613333333333,1023.0000000000001 L545.3613333333333,969.0000000000001 L492.58033333333333,969.0000000000001 L492.58033333333333,86 L398.3333333333333,86 L398.3333333333333,76",
      "badge": [
        492.58033333333333,
        528.767
      ]
    },
    "budget_dispatch": {
      "from": "budget",
      "to": "dispatch",
      "label": {
        "at": [
          435.3333333333333,
          238.79999999999998
        ],
        "text": "allowed"
      },
      "path": "M355.8333333333333,76 L355.8333333333333,96 L481.58033333333333,96 L481.58033333333333,339.20000000000005 L357.5833333333333,339.20000000000005 L357.5833333333333,393.20000000000005",
      "badge": [
        481.58033333333333,
        255.60000000000002
      ]
    },
    "budget_collect": {
      "from": "budget",
      "to": "collect",
      "label": {
        "at": [
          273.4073333333333,
          150.5
        ],
        "text": "serial"
      },
      "path": "M313.3333333333333,76 L313.3333333333333,216.6",
      "badge": [
        313.3333333333333,
        163.875
      ]
    },
    "collect_dispatch": {
      "from": "collect",
      "to": "dispatch",
      "label": {
        "at": [
          254.4443333333333,
          327.1
        ],
        "text": "all tests"
      },
      "path": "M313.3333333333333,252.6 L313.3333333333333,393.20000000000005",
      "badge": [
        313.3333333333333,
        340.475
      ]
    },
    "dispatch_fresh": {
      "from": "dispatch",
      "to": "fresh",
      "path": "M313.3333333333333,429.20000000000005 L313.3333333333333,493.20000000000005",
      "badge": [
        313.3333333333333,
        461.20000000000005
      ]
    },
    "fresh_retry": {
      "from": "fresh",
      "to": "retry",
      "label": {
        "at": [
          248.12333333333336,
          603.7
        ],
        "text": "runs again"
      },
      "path": "M313.3333333333333,529.2 L313.3333333333333,615.8000000000001 L220.66666666666666,615.8000000000001 L220.66666666666666,669.8000000000001",
      "badge": [
        283.3,
        615.8000000000001
      ]
    },
    "retry_outcome": {
      "from": "retry",
      "to": "outcome",
      "path": "M124.33333333333333,669.8000000000001 L124.33333333333333,429.20000000000005",
      "badge": [
        124.33333333333333,
        549.5
      ]
    },
    "copies_dispatch": {
      "from": "copies",
      "to": "dispatch",
      "label": {
        "at": [
          81.40733333333333,
          327.1
        ],
        "text": "copies"
      },
      "path": "M121.33333333333331,252.6 L121.33333333333331,339.20000000000005 L269.0833333333333,339.20000000000005 L269.0833333333333,393.20000000000005",
      "badge": [
        178.90833333333327,
        339.20000000000005
      ]
    },
    "later_stop": {
      "from": "later",
      "to": "stop",
      "label": {
        "at": [
          541.5063333333333,
          956.9000000000001
        ],
        "text": "stops"
      },
      "path": "M575.1113333333333,882.4000000000001 L575.1113333333333,1023.0000000000001",
      "badge": [
        575.1113333333333,
        970.2750000000001
      ]
    }
  },
  "scenarios": [
    {
      "id": "how",
      "label": "How retries work",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": false,
        "log": "incremental"
      },
      "steps": [
        {
          "id": "unexpected-differs-from-expected",
          "title": "Unexpected differs from expected",
          "text": "A non-skipped result that differs from expectedStatus is a failure for retry selection. A test.fail() failure is expected.",
          "show": [
            "failed"
          ],
          "current": [
            "failed"
          ],
          "edges": [],
          "defs": [
            "unexpected"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:376-383",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L376-L383"
            },
            {
              "label": "teleReceiver.ts:859-864",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L859-L864"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "retries-belong-to-one-testcase",
          "title": "Retries belong to one TestCase",
          "text": "A retry candidate receives another attempt only below retries + 1 results. With retries: 2, that is at most three results for one test. Non-retriable failures are excluded.",
          "show": [
            "failed",
            "budget"
          ],
          "current": [
            "budget"
          ],
          "edges": [],
          "defs": [
            "budget"
          ],
          "code": "budget",
          "sources": [
            {
              "label": "dispatcher.ts:549-552",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L549-L552"
            },
            {
              "label": "dispatcher.ts:580-590",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L580-L590"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "a-failed-job-stops-its-worker",
          "title": "A failed job stops its worker",
          "text": "The dispatcher stops a failed job’s worker. The retry starts in a fresh worker, with existing results counted as its retry index.",
          "show": [
            "failed",
            "budget",
            "dispatch",
            "stop",
            "fresh",
            "retry"
          ],
          "current": [
            "stop",
            "fresh"
          ],
          "edges": [
            "failed_stop",
            "stop_budget",
            "budget_dispatch",
            "dispatch_fresh",
            "fresh_retry"
          ],
          "defs": [
            "fresh"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:178-183",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L178-L183"
            },
            {
              "label": "dispatcher.ts:615-621",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L615-L621"
            },
            {
              "label": "dispatcher.ts:580-590",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L580-L590"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "serial-retry-collects-the-entire",
          "title": "Serial retry collects the entire suite",
          "text": "A serial failure skips the remaining tests. The failed serial suite contributes all tests to possible retry, including an earlier pass.",
          "show": [
            "budget",
            "collect",
            "dispatch",
            "first",
            "failed",
            "later",
            "stop",
            "fresh",
            "retry"
          ],
          "current": [
            "collect",
            "later",
            "first"
          ],
          "edges": [
            "first_failed",
            "failed_later",
            "budget_collect",
            "collect_dispatch"
          ],
          "defs": [
            "serial"
          ],
          "code": "serial",
          "sources": [
            {
              "label": "dispatcher.ts:554-560",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L554-L560"
            },
            {
              "label": "dispatcher.ts:563-571",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L563-L571"
            },
            {
              "label": "dispatcher.ts:573-578",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L573-L578"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "classification-uses-expected-and",
          "title": "Classification uses expected and unexpected results",
          "text": "Matching expectedStatus counts as expected. Classification combines expected and unexpected results; A failed then passed is the flaky example here.",
          "show": [
            "budget",
            "collect",
            "outcome",
            "dispatch",
            "first",
            "failed",
            "later",
            "stop",
            "fresh",
            "retry"
          ],
          "current": [
            "outcome"
          ],
          "edges": [
            "retry_outcome"
          ],
          "defs": [
            "outcome"
          ],
          "sources": [
            {
              "label": "teleReceiver.ts:859-864",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L859-L864"
            },
            {
              "label": "teleReceiver.ts:867-880",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L867-L880"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "two-retry-labels-have-different",
          "title": "Two retry labels have different roles",
          "text": "The list reporter adds (retry #1) to a second attempt. A failure-report Retry #1 separator appears only when that attempt has errors; it does not prove a successful retry failed.",
          "show": [
            "budget",
            "collect",
            "outcome",
            "dispatch",
            "first",
            "failed",
            "later",
            "stop",
            "fresh",
            "retry"
          ],
          "current": [
            "outcome"
          ],
          "edges": [],
          "defs": [
            "reporter"
          ],
          "sources": [
            {
              "label": "list.ts:276",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/reporters/list.ts#L276"
            },
            {
              "label": "base.ts:436-446",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/reporters/base.ts#L436-L446"
            },
            {
              "label": "base.ts:643-648",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/reporters/base.ts#L643-L648"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "repeateach-creates-separate-test",
          "title": "repeatEach creates separate tests before execution",
          "text": "repeatEach clones suites before execution and assigns repeated tests distinct identities. These copies exist whether other copies pass or fail.",
          "show": [
            "budget",
            "copies",
            "collect",
            "outcome",
            "dispatch",
            "first",
            "failed",
            "later",
            "stop",
            "fresh",
            "retry"
          ],
          "current": [
            "copies"
          ],
          "edges": [
            "copies_dispatch"
          ],
          "defs": [
            "copies"
          ],
          "code": "budget",
          "sources": [
            {
              "label": "loadUtils.ts:269-277",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/loadUtils.ts#L269-L277"
            },
            {
              "label": "suiteUtils.ts:87-96",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/suiteUtils.ts#L87-L96"
            },
            {
              "label": "dispatcher.ts:615-621",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L615-L621"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        }
      ]
    },
    {
      "id": "retry",
      "label": "Retry",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": false,
        "nodeBadges": true,
        "log": "incremental"
      },
      "nodeLabels": {
        "failed": "A · failed",
        "retry": "A · attempt 2 (retry #1)"
      },
      "whole": {
        "title": "A failed test runs again in a new worker",
        "text": "Example config: retries: 1."
      },
      "steps": [
        {
          "id": "a-fails-in-worker-1",
          "title": "A fails in worker 1.",
          "text": "A fails in worker 1.",
          "show": [
            "failed"
          ],
          "current": [
            "failed"
          ],
          "edges": [],
          "defs": [
            "example-0-0"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:376-383",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L376-L383"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "the-failure-stops-worker-1-the-b",
          "title": "The failure stops worker 1. The budget allows one more attempt.",
          "text": "The failure stops worker 1. The budget allows one more attempt.",
          "show": [
            "stop",
            "budget"
          ],
          "current": [
            "stop",
            "budget"
          ],
          "edges": [
            "failed_stop",
            "stop_budget"
          ],
          "defs": [
            "example-0-1"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:178-183",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L178-L183"
            },
            {
              "label": "dispatcher.ts:580-590",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L580-L590"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "the-retry-runs-in-a-fresh-worker",
          "title": "The retry runs in a fresh worker. The list reporter adds (retry #1).",
          "text": "The retry runs in a fresh worker. The list reporter adds (retry #1).",
          "show": [
            "dispatch",
            "fresh",
            "retry"
          ],
          "current": [
            "dispatch",
            "fresh",
            "retry"
          ],
          "edges": [
            "budget_dispatch",
            "dispatch_fresh",
            "fresh_retry"
          ],
          "defs": [
            "example-0-2"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:178-183",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L178-L183"
            },
            {
              "label": "dispatcher.ts:615-621",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L615-L621"
            },
            {
              "label": "list.ts:276",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/reporters/list.ts#L276"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "failed-then-passed-a-is-flaky-it",
          "title": "Failed, then passed: A is flaky. Its first failure stays in the report.",
          "text": "Failed, then passed: A is flaky. Its first failure stays in the report.",
          "show": [
            "outcome"
          ],
          "current": [
            "outcome"
          ],
          "edges": [
            "retry_outcome"
          ],
          "defs": [
            "example-0-3"
          ],
          "sources": [
            {
              "label": "teleReceiver.ts:859-864",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L859-L864"
            },
            {
              "label": "teleReceiver.ts:867-880",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L867-L880"
            },
            {
              "label": "base.ts:436-446",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/reporters/base.ts#L436-L446"
            },
            {
              "label": "base.ts:275-278",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/reporters/base.ts#L275-L278"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "failed",
          "step": "a-fails-in-worker-1",
          "log": [],
          "fail": true
        },
        {
          "node": "stop",
          "step": "the-failure-stops-worker-1-the-b",
          "log": [],
          "edge": "failed_stop"
        },
        {
          "node": "budget",
          "step": "the-failure-stops-worker-1-the-b",
          "log": [],
          "edge": "stop_budget"
        },
        {
          "node": "dispatch",
          "step": "the-retry-runs-in-a-fresh-worker",
          "log": [],
          "edge": "budget_dispatch"
        },
        {
          "node": "fresh",
          "step": "the-retry-runs-in-a-fresh-worker",
          "log": [],
          "edge": "dispatch_fresh"
        },
        {
          "node": "retry",
          "step": "the-retry-runs-in-a-fresh-worker",
          "log": [],
          "edge": "fresh_retry"
        },
        {
          "node": "outcome",
          "step": "failed-then-passed-a-is-flaky-it",
          "log": [],
          "edge": "retry_outcome"
        }
      ]
    },
    {
      "id": "serial",
      "label": "Serial",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": false,
        "nodeBadges": true,
        "log": "incremental"
      },
      "nodeLabels": {
        "first": "A · passed",
        "failed": "B · failed",
        "later": "C · skipped"
      },
      "whole": {
        "title": "A serial group runs again as a whole",
        "text": "Example: test.describe.serial with A, B, C; retries: 1."
      },
      "steps": [
        {
          "id": "b-fails-c-is-skipped-in-this-att",
          "title": "B fails. C is skipped in this attempt: it did not run.",
          "text": "B fails. C is skipped in this attempt: it did not run.",
          "show": [
            "first",
            "failed",
            "later"
          ],
          "current": [
            "first",
            "failed",
            "later"
          ],
          "edges": [
            "first_failed",
            "failed_later"
          ],
          "defs": [
            "example-1-0"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:376-383",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L376-L383"
            },
            {
              "label": "dispatcher.ts:563-571",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L563-L571"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "the-retry-takes-the-whole-group",
          "title": "The retry takes the whole group. A runs again, although it passed.",
          "text": "The retry takes the whole group. A runs again, although it passed.",
          "show": [
            "stop",
            "budget",
            "collect",
            "dispatch",
            "fresh",
            "retry"
          ],
          "current": [
            "stop",
            "budget",
            "collect",
            "dispatch",
            "fresh",
            "retry"
          ],
          "edges": [
            "later_stop",
            "stop_budget",
            "budget_collect",
            "collect_dispatch",
            "dispatch_fresh",
            "fresh_retry"
          ],
          "defs": [
            "example-1-1"
          ],
          "code": "serial",
          "sources": [
            {
              "label": "dispatcher.ts:178-183",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L178-L183"
            },
            {
              "label": "dispatcher.ts:554-560",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L554-L560"
            },
            {
              "label": "dispatcher.ts:573-578",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L573-L578"
            },
            {
              "label": "dispatcher.ts:580-590",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L580-L590"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "all-three-pass-only-b-failed-bef",
          "title": "All three pass. Only B failed before, so only B is flaky.",
          "text": "All three pass. Only B failed before, so only B is flaky.",
          "show": [
            "outcome"
          ],
          "current": [
            "outcome"
          ],
          "edges": [
            "retry_outcome"
          ],
          "defs": [
            "example-1-2"
          ],
          "sources": [
            {
              "label": "teleReceiver.ts:859-864",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L859-L864"
            },
            {
              "label": "teleReceiver.ts:867-880",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L867-L880"
            },
            {
              "label": "base.ts:275-278",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/reporters/base.ts#L275-L278"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "first",
          "step": "b-fails-c-is-skipped-in-this-att",
          "log": []
        },
        {
          "node": "failed",
          "step": "b-fails-c-is-skipped-in-this-att",
          "log": [],
          "edge": "first_failed",
          "fail": true
        },
        {
          "node": "later",
          "step": "b-fails-c-is-skipped-in-this-att",
          "log": [],
          "edge": "failed_later"
        },
        {
          "node": "stop",
          "step": "the-retry-takes-the-whole-group",
          "log": [],
          "edge": "later_stop"
        },
        {
          "node": "budget",
          "step": "the-retry-takes-the-whole-group",
          "log": [],
          "edge": "stop_budget"
        },
        {
          "node": "collect",
          "step": "the-retry-takes-the-whole-group",
          "log": [],
          "edge": "budget_collect"
        },
        {
          "node": "dispatch",
          "step": "the-retry-takes-the-whole-group",
          "log": [],
          "edge": "collect_dispatch"
        },
        {
          "node": "fresh",
          "step": "the-retry-takes-the-whole-group",
          "log": [],
          "edge": "dispatch_fresh"
        },
        {
          "node": "retry",
          "step": "the-retry-takes-the-whole-group",
          "log": [],
          "edge": "fresh_retry"
        },
        {
          "node": "outcome",
          "step": "all-three-pass-only-b-failed-bef",
          "log": [],
          "edge": "retry_outcome"
        }
      ]
    },
    {
      "id": "repeat",
      "label": "repeatEach",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": false,
        "nodeBadges": true,
        "log": "incremental"
      },
      "nodeLabels": {
        "first": "Copy 1 · passed",
        "failed": "Copy 2 · failed",
        "later": "Copy 3 · passed"
      },
      "whole": {
        "title": "repeatEach copies a test before the run",
        "text": "Example config: repeatEach: 3, retries: 0."
      },
      "steps": [
        {
          "id": "the-copies-exist-before-any-test",
          "title": "The copies exist before any test runs, passing or not.",
          "text": "The copies exist before any test runs, passing or not.",
          "show": [
            "copies"
          ],
          "current": [
            "copies"
          ],
          "edges": [],
          "defs": [
            "example-2-0"
          ],
          "code": "budget",
          "sources": [
            {
              "label": "loadUtils.ts:269-277",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/loadUtils.ts#L269-L277"
            },
            {
              "label": "suiteUtils.ts:87-96",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/suiteUtils.ts#L87-L96"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        },
        {
          "id": "each-copy-has-its-own-result-a-f",
          "title": "Each copy has its own result. A failed copy is not retried here.",
          "text": "Each copy has its own result. A failed copy is not retried here.",
          "show": [
            "dispatch",
            "first",
            "failed",
            "later",
            "outcome"
          ],
          "current": [
            "dispatch",
            "first",
            "failed",
            "later",
            "outcome"
          ],
          "edges": [
            "copies_dispatch"
          ],
          "defs": [
            "example-2-1"
          ],
          "sources": [
            {
              "label": "dispatcher.ts:580-590",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L580-L590"
            },
            {
              "label": "dispatcher.ts:615-621",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L615-L621"
            },
            {
              "label": "suiteUtils.ts:87-96",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/suiteUtils.ts#L87-L96"
            },
            {
              "label": "teleReceiver.ts:859-864",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L859-L864"
            },
            {
              "label": "teleReceiver.ts:867-880",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L867-L880"
            }
          ],
          "deeper": [
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            },
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "copies",
          "step": "the-copies-exist-before-any-test",
          "log": []
        },
        {
          "node": "dispatch",
          "step": "each-copy-has-its-own-result-a-f",
          "log": [],
          "edge": "copies_dispatch"
        },
        {
          "node": "first",
          "step": "each-copy-has-its-own-result-a-f",
          "log": []
        },
        {
          "node": "failed",
          "step": "each-copy-has-its-own-result-a-f",
          "log": [],
          "fail": true
        },
        {
          "node": "later",
          "step": "each-copy-has-its-own-result-a-f",
          "log": []
        },
        {
          "node": "outcome",
          "step": "each-copy-has-its-own-result-a-f",
          "log": []
        }
      ]
    }
  ],
  "definitions": {
    "unexpected": {
      "term": "Unexpected result",
      "text": "A non-skipped result differing from expectedStatus enters the failed-test set. test.fail() failures are expected."
    },
    "budget": {
      "term": "Retry budget",
      "text": "A candidate gets another attempt while its result count is below retries + 1."
    },
    "fresh": {
      "term": "Fresh worker",
      "text": "A failed job stops its worker; the retry runs in a fresh worker."
    },
    "serial": {
      "term": "Serial suite",
      "text": "After a serial failure, remaining tests are skipped; all tests become possible retry candidates."
    },
    "outcome": {
      "term": "Outcome",
      "text": "Expected and unexpected results determine classification. In this example, failed then passed is flaky."
    },
    "reporter": {
      "term": "Reporter output",
      "text": "The list reporter adds (retry #N). Failure-report Retry #N headings require errors in that attempt."
    },
    "copies": {
      "term": "repeatEach",
      "text": "Before execution, suites are cloned and repeated tests receive distinct identities."
    },
    "example-0-0": {
      "term": "Example state",
      "text": "retries: 1 · Worker 1 runs A · A · attempt 1 · Result: failed · Summary: not yet"
    },
    "example-0-1": {
      "term": "Example state",
      "text": "retries: 1 · one more attempt allowed · Worker 1 stops after the failure · A · attempt 1 · Result: failed · Summary: not yet"
    },
    "example-0-2": {
      "term": "Example state",
      "text": "retries: 1 · one more attempt allowed · Worker 2 starts and runs A again · A · attempt 1 · Result: failed · A · attempt 2 (retry #1) · Result: running · Summary: not yet"
    },
    "example-0-3": {
      "term": "Example state",
      "text": "retries: 1 · budget used · Worker 2 runs A again · A · attempt 1 · Result: failed · A · attempt 2 (retry #1) · Result: passed · Summary: 1 flaky: A"
    },
    "example-1-0": {
      "term": "Example state",
      "text": "retries: 1 · describe.serial · Worker 1 runs A, then B · A · attempt 1 · Result: passed · B · attempt 1 · Result: failed · C · attempt 1 · Result: skipped · Summary: not yet"
    },
    "example-1-1": {
      "term": "Example state",
      "text": "retries: 1 · describe.serial · Worker 1 stops. Worker 2 starts. · A · attempt 2 (retry #1) · Result: running · B · attempt 2 (retry #1) · Result: waiting · C · attempt 2 (retry #1) · Result: waiting · Summary: not yet"
    },
    "example-1-2": {
      "term": "Example state",
      "text": "retries: 1 · budget used · Worker 2 runs A, B and C · A · attempt 2 (retry #1) · Result: passed · B · attempt 2 (retry #1) · Result: passed · C · attempt 2 (retry #1) · Result: passed · Summary: 1 flaky: B · 2 passed: A, C"
    },
    "example-2-0": {
      "term": "Example state",
      "text": "repeatEach: 3 · Three copies of A are three tests · A copy 1 · attempt 1 · Result: waiting · A copy 2 · attempt 1 · Result: waiting · A copy 3 · attempt 1 · Result: waiting · Summary: not yet"
    },
    "example-2-1": {
      "term": "Example state",
      "text": "repeatEach: 3 · Each copy runs once · A copy 1 · attempt 1 · Result: passed · A copy 2 · attempt 1 · Result: failed · A copy 3 · attempt 1 · Result: passed · Summary: 1 failed · 2 passed"
    },
    "identity": {
      "term": "Test identity",
      "text": "Repeated tests receive distinct identities."
    }
  },
  "code": {
    "serial": {
      "title": "Inside Playwright · dispatcher.ts",
      "source": {
        "label": "dispatcher.ts:573-578",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L573-L578"
      },
      "lines": [
        "for (const serialSuite of serialSuitesWithFailures) {",
        "  // Add all tests from failed serial suites for possible retry.",
        "  // These will only be retried together, because they have the same",
        "  // \"retries\" setting and the same number of previous runs.",
        "  serialSuite.allTests().forEach(test => retryCandidates.add(test));",
        "}"
      ]
    },
    "budget": {
      "title": "In your test · retry budget",
      "lines": [
        "// ✗ This repeats successful tests too",
        "export default { repeatEach: 3 };",
        "// ✓ Allow two retries after failure",
        "export default { retries: 2 };"
      ]
    }
  },
  "conceptScenario": "how",
  "concepts": [
    {
      "label": "Runner",
      "layer": "runner",
      "items": [
        {
          "definition": "budget",
          "short": "Another attempt requires fewer than retries + 1 results.",
          "nodes": [
            "budget"
          ],
          "step": {
            "step": "retries-belong-to-one-testcase"
          },
          "source": {
            "label": "dispatcher.ts:580-590",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L580-L590"
          }
        },
        {
          "definition": "serial",
          "short": "All tests in the failed serial suite become retry candidates.",
          "nodes": [
            "collect"
          ],
          "step": {
            "step": "serial-retry-collects-the-entire"
          },
          "source": {
            "label": "dispatcher.ts:573-578",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L573-L578"
          }
        },
        {
          "definition": "outcome",
          "short": "Expected and unexpected results determine the outcome.",
          "nodes": [
            "outcome"
          ],
          "step": {
            "step": "classification-uses-expected-and"
          },
          "source": {
            "label": "teleReceiver.ts:867-880",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/isomorphic/teleReceiver.ts#L867-L880"
          }
        },
        {
          "definition": "copies",
          "short": "Suites are cloned before execution.",
          "nodes": [
            "copies"
          ],
          "step": {
            "step": "repeateach-creates-separate-test"
          },
          "source": {
            "label": "loadUtils.ts:269-277",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/loadUtils.ts#L269-L277"
          }
        },
        {
          "definition": "identity",
          "short": "Repetitions receive distinct test identities.",
          "nodes": [
            "copies"
          ],
          "step": {
            "step": "repeateach-creates-separate-test"
          },
          "source": {
            "label": "suiteUtils.ts:87-96",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/suiteUtils.ts#L87-L96"
          }
        }
      ]
    },
    {
      "label": "Worker process",
      "layer": "test",
      "items": [
        {
          "definition": "unexpected",
          "short": "A non-skipped result differs from expectedStatus.",
          "nodes": [
            "failed"
          ],
          "step": {
            "step": "unexpected-differs-from-expected"
          },
          "source": {
            "label": "dispatcher.ts:376-383",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L376-L383"
          }
        },
        {
          "definition": "fresh",
          "short": "The dispatcher stops the worker of a failed job.",
          "nodes": [
            "stop"
          ],
          "step": {
            "step": "a-failed-job-stops-its-worker"
          },
          "source": {
            "label": "dispatcher.ts:178-183",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/dispatcher.ts#L178-L183"
          }
        }
      ]
    }
  ],
  "callouts": {
    "1": [
      "budget",
      "stop",
      "fresh",
      "retry"
    ],
    "2": [
      "collect",
      "first",
      "failed",
      "later",
      "retry"
    ],
    "3": [
      "outcome"
    ],
    "4": [
      "copies"
    ]
  },
  "deeper": [
    {
      "title": "0.1 API calls leave from Node, page calls from the browser",
      "href": "/0-anatomy/0-1-anatomy-of-a-test/",
      "why": "Runner and worker process boundaries."
    },
    {
      "title": "4.2 Built on demand, torn down in reverse",
      "href": "/4-runner/4-2-custom-fixtures/",
      "why": "Setup and teardown around test execution."
    },
    {
      "title": "4.3 Workers take groups, shards keep them whole",
      "href": "/4-runner/4-3-workers-and-parallel/",
      "why": "Groups, dispatch and worker reuse."
    }
  ],
  "viewBox": [
    732.3583333333332,
    1087
  ],
  "measurement": {
    "name": "font-table",
    "labels": {
      "first_failed": {
        "width": 69.53099999999999,
        "height": 12.6
      },
      "failed_later": {
        "width": 69.53099999999999,
        "height": 12.6
      },
      "failed_stop": {
        "width": 44.24699999999999,
        "height": 12.6
      },
      "budget_dispatch": {
        "width": 44.24699999999999,
        "height": 12.6
      },
      "budget_collect": {
        "width": 37.925999999999995,
        "height": 12.6
      },
      "collect_dispatch": {
        "width": 56.88899999999999,
        "height": 12.6
      },
      "fresh_retry": {
        "width": 63.20999999999999,
        "height": 12.6
      },
      "copies_dispatch": {
        "width": 37.925999999999995,
        "height": 12.6
      },
      "later_stop": {
        "width": 31.604999999999997,
        "height": 12.6
      }
    }
  }
}
