{
  "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": 509.8,
      "x": 16,
      "w": 969.2655
    },
    "worker": {
      "label": "WORKER PROCESS",
      "layer": "runner",
      "y": 553.8,
      "h": 409.79999999999995,
      "x": 16,
      "w": 969.2655
    }
  },
  "frames": {
    "serialQualification": {
      "label": "RESULT-ROW ARROWS · SERIAL ONLY",
      "showWith": [
        "copies"
      ],
      "box": [
        585.7655,
        237.2,
        239.48099999999988,
        76
      ]
    }
  },
  "nodes": {
    "budget": {
      "label": "Retry budget · one test",
      "layer": "runner",
      "lane": "runner",
      "box": [
        380.76550000000003,
        40,
        170,
        36
      ]
    },
    "copies": {
      "label": "repeatEach copies",
      "layer": "runner",
      "lane": "runner",
      "box": [
        597.7655,
        265.2,
        140,
        36
      ]
    },
    "collect": {
      "label": "Collect entire serial suite",
      "layer": "runner",
      "lane": "runner",
      "box": [
        385.7655,
        265.2,
        180,
        36
      ]
    },
    "outcome": {
      "label": "Classify all results",
      "layer": "runner",
      "lane": "runner",
      "box": [
        760.2655,
        477.8,
        137,
        36
      ]
    },
    "dispatch": {
      "label": "Dispatcher · worker jobs",
      "layer": "runner",
      "lane": "runner",
      "box": [
        615.3209999999999,
        152.6,
        177,
        36
      ]
    },
    "first": {
      "label": "Earlier pass",
      "layer": "app",
      "lane": "worker",
      "box": [
        32,
        690.4,
        124,
        36
      ]
    },
    "failed": {
      "label": "Unexpected",
      "layer": "fail",
      "lane": "worker",
      "fail": true,
      "box": [
        154.48450000000003,
        577.8,
        115,
        36
      ]
    },
    "later": {
      "label": "Later test",
      "layer": "app",
      "lane": "worker",
      "box": [
        226.73450000000003,
        803,
        124,
        36
      ]
    },
    "stop": {
      "label": "Worker 1 stops",
      "layer": "runner",
      "lane": "worker",
      "box": [
        188,
        690.4,
        119,
        36
      ]
    },
    "fresh": {
      "label": "Fresh worker 2",
      "layer": "runner",
      "lane": "worker",
      "box": [
        769.7655,
        803,
        118,
        36
      ]
    },
    "retry": {
      "label": "Retry body · same test / whole serial suite",
      "layer": "app",
      "lane": "worker",
      "box": [
        684.2655,
        915.5999999999999,
        289,
        36
      ]
    }
  },
  "edges": {
    "first_failed": {
      "from": "first",
      "to": "failed",
      "label": {
        "at": [
          103.17157287525382,
          659.1284271247462
        ],
        "text": "serial only"
      },
      "path": "M94,690.4 L94,652.0999999999999 L174.26299023090587,613.8",
      "badge": [
        139.14793200488455,
        630.55625
      ]
    },
    "failed_later": {
      "from": "failed",
      "to": "later",
      "label": {
        "at": [
          345,
          712.6
        ],
        "text": "serial only"
      },
      "path": "M250.67506838365898,613.8 L333,652.0999999999999 L333,708.4 L333,764.6999999999999 L302.88688010657194,803",
      "badge": [
        333,
        687.3612439041815
      ]
    },
    "failed_stop": {
      "from": "failed",
      "to": "stop",
      "label": {
        "at": [
          259.5,
          656.3
        ],
        "text": "failure"
      },
      "path": "M223.33936678507996,613.8 L247.5,652.0999999999999 L247.5,690.4",
      "badge": [
        245.636929156881,
        649.1466165908517
      ]
    },
    "stop_budget": {
      "from": "stop",
      "to": "budget",
      "path": "M247.5,690.4 L247.5,383.2 L465.76550000000003,383.2 L465.76550000000003,76",
      "badge": [
        356.63275000000004,
        383.2
      ]
    },
    "budget_dispatch": {
      "from": "budget",
      "to": "dispatch",
      "label": {
        "at": [
          715.8209999999999,
          118.5
        ],
        "text": "allowed"
      },
      "path": "M541.875606571936,76 L703.8209999999999,114.3 L703.8209999999999,152.6",
      "badge": [
        641.4842217903301,
        99.5573848820783
      ]
    },
    "budget_collect": {
      "from": "budget",
      "to": "collect",
      "label": {
        "at": [
          487.7655,
          174.79999999999998
        ],
        "text": "serial"
      },
      "path": "M468.9626580817052,76 L475.7655,114.3 L475.7655,170.6 L475.7655,226.9 L475.7655,265.2",
      "badge": [
        475.7655,
        170.30026569483977
      ]
    },
    "collect_dispatch": {
      "from": "collect",
      "to": "dispatch",
      "label": {
        "at": [
          750.7839999999999,
          231.1
        ],
        "text": "all tests"
      },
      "path": "M559.8566722912966,265.2 L738.7839999999999,226.9 L714.9992238010656,188.6",
      "badge": [
        671.3632157211091,
        241.33164703205878
      ]
    },
    "dispatch_fresh": {
      "from": "dispatch",
      "to": "fresh",
      "path": "M703.8209999999999,188.6 L703.8209999999999,495.8 L828.7655,495.8 L828.7655,803",
      "badge": [
        746.770671875,
        495.8
      ]
    },
    "fresh_retry": {
      "from": "fresh",
      "to": "retry",
      "label": {
        "at": [
          840.7655,
          881.5
        ],
        "text": "runs again"
      },
      "path": "M828.7655,839 L828.7655,877.3 L828.7655,915.5999999999999",
      "badge": [
        828.7655,
        877.3
      ]
    },
    "retry_outcome": {
      "from": "retry",
      "to": "outcome",
      "path": "M828.7655,915.5999999999999 L828.7655,714.6999999999999 L828.7655,714.6999999999999 L828.7655,513.8",
      "badge": [
        828.7655,
        714.6999999999999
      ]
    },
    "copies_dispatch": {
      "from": "copies",
      "to": "dispatch",
      "label": {
        "at": [
          636.5704941718473,
          204.04375000000002
        ],
        "text": "copies"
      },
      "path": "M667.7655,265.2 L667.7655,226.9 L692.293486678508,188.6",
      "badge": [
        662.1086457505075,
        221.24314575050764
      ]
    },
    "later_stop": {
      "from": "later",
      "to": "stop",
      "label": {
        "at": [
          259.5,
          768.9
        ],
        "text": "stops"
      },
      "path": "M275.5511785079929,803 L247.5,764.6999999999999 L247.5,726.4",
      "badge": [
        247.5,
        764.6999999999999
      ]
    }
  },
  "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": [
    1001.2655,
    979.5999999999999
  ],
  "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
      }
    }
  }
}
