{
  "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": 609.8,
      "x": 16,
      "w": 482.1235
    },
    "worker": {
      "label": "WORKER PROCESS",
      "layer": "runner",
      "y": 653.8,
      "h": 947.6000000000001,
      "x": 16,
      "w": 482.1235
    }
  },
  "frames": {
    "serialQualification": {
      "label": "RESULT-ROW ARROWS · SERIAL ONLY",
      "showWith": [
        "copies"
      ],
      "box": [
        20,
        124.59999999999997,
        239.48099999999988,
        76
      ]
    }
  },
  "nodes": {
    "budget": {
      "label": "Retry budget · one test",
      "layer": "runner",
      "lane": "runner",
      "box": [
        267,
        40,
        170,
        36
      ]
    },
    "copies": {
      "label": "repeatEach copies",
      "layer": "runner",
      "lane": "runner",
      "box": [
        32,
        152.59999999999997,
        140,
        36
      ]
    },
    "collect": {
      "label": "Collect entire serial suite",
      "layer": "runner",
      "lane": "runner",
      "box": [
        204,
        152.59999999999997,
        180,
        36
      ]
    },
    "outcome": {
      "label": "Classify all results",
      "layer": "runner",
      "lane": "runner",
      "box": [
        225.5,
        577.8,
        137,
        36
      ]
    },
    "dispatch": {
      "label": "Dispatcher · worker jobs",
      "layer": "runner",
      "lane": "runner",
      "box": [
        205.5,
        265.2,
        177,
        36
      ]
    },
    "first": {
      "label": "Earlier pass",
      "layer": "app",
      "lane": "worker",
      "box": [
        290,
        677.8,
        124,
        36
      ]
    },
    "failed": {
      "label": "Unexpected",
      "layer": "fail",
      "lane": "worker",
      "fail": true,
      "box": [
        294.5,
        790.4,
        115,
        36
      ]
    },
    "later": {
      "label": "Later test",
      "layer": "app",
      "lane": "worker",
      "box": [
        362.1235,
        903,
        124,
        36
      ]
    },
    "stop": {
      "label": "Worker 1 stops",
      "layer": "runner",
      "lane": "worker",
      "box": [
        292.5,
        1015.5999999999999,
        119,
        36
      ]
    },
    "fresh": {
      "label": "Fresh worker 2",
      "layer": "runner",
      "lane": "worker",
      "box": [
        235,
        1440.8,
        118,
        36
      ]
    },
    "retry": {
      "label": "Retry body · same test / whole serial suite",
      "layer": "app",
      "lane": "worker",
      "box": [
        149.5,
        1553.4,
        289,
        36
      ]
    }
  },
  "edges": {
    "first_failed": {
      "from": "first",
      "to": "failed",
      "label": {
        "at": [
          364,
          756.3
        ],
        "text": "serial only"
      },
      "path": "M352,713.8 L352,752.0999999999999 L352,790.4",
      "badge": [
        352,
        752.0999999999999
      ]
    },
    "failed_later": {
      "from": "failed",
      "to": "later",
      "label": {
        "at": [
          436.1235,
          868.9
        ],
        "text": "serial only"
      },
      "path": "M375.05902309058615,826.4 L424.1235,864.6999999999999 L424.1235,903",
      "badge": [
        414.6866471116872,
        857.3335408346514
      ]
    },
    "failed_stop": {
      "from": "failed",
      "to": "stop",
      "label": {
        "at": [
          231.62950000000006,
          943.05
        ],
        "text": "failure"
      },
      "path": "M328.94097690941385,826.4 L279.8765,864.6999999999999 L279.8765,921 L279.8765,977.3 L328.94097690941385,1015.5999999999999",
      "badge": [
        279.8765,
        921
      ]
    },
    "stop_budget": {
      "from": "stop",
      "to": "budget",
      "path": "M352,1015.5999999999999 L352,545.8 L352,545.8 L352,76",
      "badge": [
        352,
        545.8
      ]
    },
    "budget_dispatch": {
      "from": "budget",
      "to": "dispatch",
      "label": {
        "at": [
          422,
          174.79999999999995
        ],
        "text": "allowed"
      },
      "path": "M370.54351687388987,76 L410,114.30000000000001 L410,170.59999999999997 L410,226.89999999999992 L331.0870337477797,265.2",
      "badge": [
        410,
        186.96403259155414
      ]
    },
    "budget_collect": {
      "from": "budget",
      "to": "collect",
      "label": {
        "at": [
          305.99999999999994,
          118.50000000000001
        ],
        "text": "serial"
      },
      "path": "M333.45648312611013,76 L294,114.30000000000001 L294,152.59999999999997",
      "badge": [
        294,
        119.0875
      ]
    },
    "collect_dispatch": {
      "from": "collect",
      "to": "dispatch",
      "label": {
        "at": [
          235.78515552914223,
          260.1839408597467
        ],
        "text": "all tests"
      },
      "path": "M294,188.59999999999997 L294,226.89999999999992 L294,265.2",
      "badge": [
        294,
        226.89999999999998
      ]
    },
    "dispatch_fresh": {
      "from": "dispatch",
      "to": "fresh",
      "path": "M294,301.2 L294,871 L294,871 L294,1440.8",
      "badge": [
        294,
        871
      ]
    },
    "fresh_retry": {
      "from": "fresh",
      "to": "retry",
      "label": {
        "at": [
          306,
          1519.3
        ],
        "text": "runs again"
      },
      "path": "M294,1476.8 L294,1515.1 L294,1553.4",
      "badge": [
        294,
        1515.1
      ]
    },
    "retry_outcome": {
      "from": "retry",
      "to": "outcome",
      "path": "M294,1553.4 L294,1083.6 L294,1083.6 L294,613.8",
      "badge": [
        294,
        1083.6
      ]
    },
    "copies_dispatch": {
      "from": "copies",
      "to": "dispatch",
      "label": {
        "at": [
          112.46926627053966,
          227.4044818699548
        ],
        "text": "copies"
      },
      "path": "M102,188.59999999999997 L102,226.89999999999992 L232.6145648312612,265.2",
      "badge": [
        159.14387211367676,
        243.65624999999994
      ]
    },
    "later_stop": {
      "from": "later",
      "to": "stop",
      "label": {
        "at": [
          436.1235,
          981.5
        ],
        "text": "stops"
      },
      "path": "M424.1235,939 L424.1235,977.3 L375.05902309058615,1015.5999999999999",
      "badge": [
        414.6866471116872,
        984.6664591653484
      ]
    }
  },
  "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": [
    521.6545,
    1617.4
  ],
  "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
      }
    }
  }
}
