{
  "format": 3,
  "id": "4.1",
  "title": "Configuration, project success gates and reverse run cleanup",
  "layers": {
    "runner": {
      "label": "Runner"
    },
    "app": {
      "label": "App"
    },
    "test": {
      "label": "Test"
    }
  },
  "lanes": {
    "run": {
      "label": "RUNNER · CONFIGURATION AND RUN TASKS",
      "layer": "runner",
      "y": 6,
      "h": 236
    },
    "phases": {
      "label": "RUNNER · PROJECT PHASES",
      "layer": "runner",
      "y": 254,
      "h": 232
    },
    "cleanup": {
      "label": "RUNNER · CLEANUP",
      "layer": "runner",
      "y": 512,
      "h": 82
    }
  },
  "frames": {},
  "nodes": {
    "config": {
      "label": "retries: CLI 0 · project 2 · config 1",
      "layer": "runner",
      "lane": "run",
      "box": [
        16,
        34,
        388,
        34
      ]
    },
    "ready": {
      "label": "webServer readiness",
      "layer": "runner",
      "lane": "run",
      "box": [
        16,
        160,
        184,
        34
      ]
    },
    "global": {
      "label": "globalSetup",
      "layer": "runner",
      "lane": "run",
      "box": [
        220,
        160,
        184,
        34
      ]
    },
    "setup": {
      "label": "Phase 1 · setup",
      "layer": "app",
      "lane": "phases",
      "box": [
        40,
        282,
        340,
        34
      ]
    },
    "web": {
      "label": "Phase 2 · web",
      "layer": "app",
      "lane": "phases",
      "box": [
        40,
        362,
        340,
        34
      ]
    },
    "clean": {
      "label": "Phase 3 · clean",
      "layer": "app",
      "lane": "phases",
      "box": [
        40,
        442,
        340,
        34
      ]
    },
    "returned": {
      "label": "globalSetup cleanup",
      "layer": "runner",
      "lane": "cleanup",
      "box": [
        16,
        552,
        180,
        34
      ]
    },
    "server": {
      "label": "server cleanup",
      "layer": "runner",
      "lane": "cleanup",
      "box": [
        220,
        552,
        184,
        34
      ]
    },
    "probe": {
      "label": "availability probe",
      "layer": "runner",
      "lane": "run",
      "box": [
        16,
        104,
        184,
        34
      ]
    }
  },
  "edges": {
    "config_ready": {
      "from": "config",
      "to": "probe",
      "label": {
        "at": [
          120,
          88
        ],
        "text": "run setup"
      },
      "path": "M108,68 V102",
      "badge": [
        108,
        86
      ]
    },
    "ready_global": {
      "from": "ready",
      "to": "global",
      "label": {
        "at": [
          250,
          140
        ],
        "text": "ready"
      },
      "path": "M180 160 V157 H312 V158"
    },
    "global_setup": {
      "from": "global",
      "to": "setup",
      "label": {
        "at": [
          244,
          251
        ],
        "text": "tests follow"
      },
      "path": "M312,194 V234 H392 V299 H382",
      "badge": [
        392,
        234
      ]
    },
    "setup_web": {
      "from": "setup",
      "to": "web",
      "label": {
        "at": [
          222,
          343
        ],
        "text": "success gate"
      },
      "path": "M210,316 V360",
      "badge": [
        210,
        337
      ]
    },
    "web_clean": {
      "from": "web",
      "to": "clean",
      "label": {
        "at": [
          222,
          425
        ],
        "text": "processed users"
      },
      "path": "M210,396 V440",
      "badge": [
        210,
        418
      ]
    },
    "clean_returned": {
      "from": "clean",
      "to": "returned",
      "label": {
        "at": [
          220,
          500
        ],
        "text": "returned cleanup"
      },
      "path": "M210,476 V498 H8 V569 H14",
      "badge": [
        108,
        498
      ]
    },
    "returned_server": {
      "from": "returned",
      "to": "server",
      "label": {
        "at": [
          235,
          530
        ],
        "text": "reverse cleanup"
      },
      "path": "M196 569 H210 V540 H312 V550",
      "badge": [
        208,
        569
      ]
    },
    "ready_server": {
      "from": "ready",
      "to": "server",
      "label": {
        "at": [
          120,
          209
        ],
        "text": "readiness error"
      },
      "dashed": true,
      "path": "M108,194 V214 H412 V604 H312 V588",
      "badge": [
        412,
        496
      ]
    },
    "probe_ready": {
      "from": "probe",
      "to": "ready",
      "label": {
        "at": [
          120,
          151
        ],
        "text": "start + wait"
      },
      "path": "M108,138 V158",
      "badge": [
        108,
        148
      ]
    }
  },
  "scenarios": [
    {
      "id": "how",
      "label": "How projects run",
      "display": {
        "counterLabel": false,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "steps": [
        {
          "id": "the-first-defined-retries-value",
          "title": "The first defined retries value wins",
          "text": "Retries select CLI, project, root configuration, then zero. Zero counts as defined.",
          "show": [
            "config"
          ],
          "current": [
            "config"
          ],
          "edges": [],
          "defs": [
            "config"
          ],
          "code": "first",
          "sources": [
            {
              "label": "config.ts:189-192",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/config.ts#L189-L192"
            },
            {
              "label": "util.ts:378-384",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/util.ts#L378-L384"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "the-server-plugin-waits-for-read",
          "title": "The server plugin waits for readiness",
          "text": "An available server is reused only when allowed. An unavailable server starts, then waits for readiness.",
          "show": [
            "probe",
            "ready"
          ],
          "current": [
            "ready"
          ],
          "edges": [
            "config_ready",
            "probe_ready"
          ],
          "defs": [
            "ready"
          ],
          "sources": [
            {
              "label": "testRunner.ts:430-450",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testRunner.ts#L430-L450"
            },
            {
              "label": "tasks.ts:156-162",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L156-L162"
            },
            {
              "label": "webServerPlugin.ts:72-89",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L72-L89"
            },
            {
              "label": "webServerPlugin.ts:96-102",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L96-L102"
            },
            {
              "label": "webServerPlugin.ts:194-209",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L194-L209"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "plugin-setup-precedes-globalsetu",
          "title": "Plugin setup precedes globalSetup",
          "text": "For an ordinary run, plugin setup precedes globalSetup and project tests. GlobalSetup receives configuration and may return cleanup.",
          "show": [
            "global"
          ],
          "current": [
            "global"
          ],
          "edges": [
            "ready_global"
          ],
          "defs": [
            "global"
          ],
          "sources": [
            {
              "label": "testRunner.ts:430-450",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testRunner.ts#L430-L450"
            },
            {
              "label": "tasks.ts:156-162",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L156-L162"
            },
            {
              "label": "tasks.ts:213-223",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L213-L223"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "dependencies-establish-project-p",
          "title": "Dependencies establish project phases",
          "text": "Names become project references. A phase waits for dependencies to be processed; array order does not express the dependency.",
          "show": [
            "setup"
          ],
          "current": [
            "setup"
          ],
          "edges": [
            "global_setup"
          ],
          "defs": [
            "phase"
          ],
          "code": "projects",
          "sources": [
            {
              "label": "config.ts:255-263",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/config.ts#L255-L263"
            },
            {
              "label": "tasks.ts:382-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
            },
            {
              "label": "testRunner.ts:430-450",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testRunner.ts#L430-L450"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "success-is-checked-separately",
          "title": "Success is checked separately",
          "text": "An unsuccessful dependency contributes no test groups. A project enters the successful set only without worker errors, unsuccessful dependencies or tests that are not OK.",
          "show": [
            "web"
          ],
          "current": [
            "web"
          ],
          "edges": [
            "setup_web"
          ],
          "defs": [
            "gate"
          ],
          "code": "gate",
          "sources": [
            {
              "label": "tasks.ts:451-454",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451-L454"
            },
            {
              "label": "tasks.ts:468-475",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L468-L475"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "teardown-waits-for-setup-and-its",
          "title": "Teardown waits for setup and its users",
          "text": "A teardown project waits for its setup and that setup’s consumers to be processed. It cannot have dependencies of its own.",
          "show": [
            "clean"
          ],
          "current": [
            "clean"
          ],
          "edges": [
            "web_clean"
          ],
          "defs": [
            "teardown"
          ],
          "sources": [
            {
              "label": "config.ts:265-278",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/config.ts#L265-L278"
            },
            {
              "label": "tasks.ts:382-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "returned-globalsetup-cleanup-run",
          "title": "Returned globalSetup cleanup runs",
          "text": "GlobalSetup may return a function, which the task calls during teardown. Registered task cleanup runs in reverse order.",
          "show": [
            "returned"
          ],
          "current": [
            "returned"
          ],
          "edges": [
            "clean_returned"
          ],
          "defs": [
            "returned"
          ],
          "sources": [
            {
              "label": "tasks.ts:213-223",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L213-L223"
            },
            {
              "label": "taskRunner.ts:63-83",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/taskRunner.ts#L63-L83"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "server-cleanup-runs-after-global",
          "title": "Server cleanup runs after globalSetup cleanup",
          "text": "Plugin setup precedes globalSetup, so reverse task cleanup runs returned globalSetup cleanup before server cleanup. Server teardown terminates its process.",
          "show": [
            "server"
          ],
          "current": [
            "server"
          ],
          "edges": [
            "returned_server"
          ],
          "defs": [
            "server"
          ],
          "sources": [
            {
              "label": "tasks.ts:156-162",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L156-L162"
            },
            {
              "label": "taskRunner.ts:63-83",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/taskRunner.ts#L63-L83"
            },
            {
              "label": "webServerPlugin.ts:72-89",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L72-L89"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        }
      ]
    },
    {
      "id": "success",
      "label": "Success",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Successful setup",
        "text": "Example: --retries=0 on the CLI wins. Dependencies run first; cleanup runs in reverse."
      },
      "steps": [
        {
          "id": "retries-0-wins-the-web-server-is",
          "title": "--retries=0 wins. The web server is ready before globalSetup.",
          "text": "--retries=0 wins. The web server is ready before globalSetup.",
          "show": [
            "config",
            "probe",
            "ready",
            "global"
          ],
          "current": [
            "global"
          ],
          "edges": [
            "config_ready",
            "probe_ready",
            "ready_global"
          ],
          "defs": [],
          "code": "first",
          "log": [],
          "sources": [
            {
              "label": "config.ts:189-192",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/config.ts#L189-L192"
            },
            {
              "label": "util.ts:378-384",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/util.ts#L378-L384"
            },
            {
              "label": "testRunner.ts:430-450",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/testRunner.ts#L430-L450"
            },
            {
              "label": "tasks.ts:156-162",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L156-L162"
            },
            {
              "label": "webServerPlugin.ts:72-89",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L72-L89"
            },
            {
              "label": "webServerPlugin.ts:96-102",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L96-L102"
            },
            {
              "label": "webServerPlugin.ts:194-209",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L194-L209"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "setup-succeeds-in-phase-1-web-s",
          "title": "Setup succeeds in phase 1; web's success gate can open.",
          "text": "Setup succeeds in phase 1; web's success gate can open.",
          "show": [
            "setup"
          ],
          "current": [
            "setup"
          ],
          "edges": [
            "global_setup"
          ],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "tasks.ts:382-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
            },
            {
              "label": "tasks.ts:451-454",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451-L454"
            },
            {
              "label": "tasks.ts:468-475",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L468-L475"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "web-succeeds-in-phase-2-after-it",
          "title": "Web succeeds in phase 2 after its setup dependency.",
          "text": "Web succeeds in phase 2 after its setup dependency.",
          "show": [
            "web"
          ],
          "current": [
            "web"
          ],
          "edges": [
            "setup_web"
          ],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "tasks.ts:382-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
            },
            {
              "label": "tasks.ts:451-454",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451-L454"
            },
            {
              "label": "tasks.ts:468-475",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L468-L475"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "clean-succeeds-in-phase-3-after",
          "title": "Clean succeeds in phase 3 after setup and web finish.",
          "text": "Clean succeeds in phase 3 after setup and web finish.",
          "show": [
            "clean"
          ],
          "current": [
            "clean"
          ],
          "edges": [
            "web_clean"
          ],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "config.ts:265-278",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/config.ts#L265-L278"
            },
            {
              "label": "tasks.ts:382-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
            },
            {
              "label": "tasks.ts:451-454",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451-L454"
            },
            {
              "label": "tasks.ts:468-475",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L468-L475"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "returned-globalsetup-cleanup-run",
          "title": "Returned globalSetup cleanup runs before server cleanup.",
          "text": "Returned globalSetup cleanup runs before server cleanup.",
          "show": [
            "returned",
            "server"
          ],
          "current": [
            "returned"
          ],
          "edges": [
            "clean_returned",
            "returned_server"
          ],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "tasks.ts:156-162",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L156-L162"
            },
            {
              "label": "tasks.ts:213-223",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L213-L223"
            },
            {
              "label": "taskRunner.ts:63-83",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/taskRunner.ts#L63-L83"
            },
            {
              "label": "webServerPlugin.ts:72-89",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L72-L89"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "config",
          "step": "retries-0-wins-the-web-server-is",
          "log": []
        },
        {
          "node": "probe",
          "step": "retries-0-wins-the-web-server-is",
          "log": [],
          "edge": "config_ready"
        },
        {
          "node": "ready",
          "step": "retries-0-wins-the-web-server-is",
          "log": [],
          "edge": "probe_ready"
        },
        {
          "node": "global",
          "step": "retries-0-wins-the-web-server-is",
          "log": [],
          "edge": "ready_global"
        },
        {
          "node": "setup",
          "step": "setup-succeeds-in-phase-1-web-s",
          "log": [],
          "edge": "global_setup"
        },
        {
          "node": "web",
          "step": "web-succeeds-in-phase-2-after-it",
          "log": [],
          "edge": "setup_web"
        },
        {
          "node": "clean",
          "step": "clean-succeeds-in-phase-3-after",
          "log": [],
          "edge": "web_clean"
        },
        {
          "node": "returned",
          "step": "returned-globalsetup-cleanup-run",
          "log": [],
          "edge": "clean_returned"
        },
        {
          "node": "server",
          "step": "returned-globalsetup-cleanup-run",
          "log": [],
          "edge": "returned_server"
        }
      ]
    },
    {
      "id": "setup-fails",
      "label": "Setup fails",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "nodeLabels": {
        "setup": "Phase 1 · setup failed",
        "web": "Phase 2 · web blocked"
      },
      "whole": {
        "title": "Setup fails",
        "text": "Example: an ordinary setup-test failure blocks web. Clean has no ordinary dependency and still runs."
      },
      "steps": [
        {
          "id": "setup-failed-processed-does-not",
          "title": "Setup failed: processed does not mean successful.",
          "text": "Setup failed: processed does not mean successful.",
          "show": [
            "config",
            "probe",
            "ready",
            "global",
            "setup"
          ],
          "current": [
            "setup"
          ],
          "edges": [],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "tasks.ts:382-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
            },
            {
              "label": "tasks.ts:468-475",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L468-L475"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "web-s-success-gate-blocks-its-te",
          "title": "Web's success gate blocks its test groups.",
          "text": "Web's success gate blocks its test groups.",
          "show": [
            "web"
          ],
          "current": [
            "web"
          ],
          "edges": [
            "setup_web"
          ],
          "defs": [],
          "code": "gate",
          "log": [],
          "sources": [
            {
              "label": "tasks.ts:451-454",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451-L454"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "clean-completes-after-setup-and",
          "title": "Clean completes after setup and its consumer are processed.",
          "text": "Clean completes after setup and its consumer are processed.",
          "show": [
            "clean"
          ],
          "current": [
            "clean"
          ],
          "edges": [
            "web_clean"
          ],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "config.ts:265-278",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/config.ts#L265-L278"
            },
            {
              "label": "tasks.ts:382-398",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
            },
            {
              "label": "tasks.ts:451-454",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451-L454"
            },
            {
              "label": "tasks.ts:468-475",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L468-L475"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "setup",
          "step": "setup-failed-processed-does-not",
          "log": [],
          "fail": true
        },
        {
          "node": "web",
          "step": "web-s-success-gate-blocks-its-te",
          "log": [],
          "edge": "setup_web",
          "fail": true
        },
        {
          "node": "clean",
          "step": "clean-completes-after-setup-and",
          "log": [],
          "edge": "web_clean"
        }
      ]
    },
    {
      "id": "server-timeout",
      "label": "Server timeout",
      "display": {
        "counterLabel": true,
        "edges": "progressive",
        "edgeBadges": true,
        "nodeBadges": true,
        "log": "incremental"
      },
      "whole": {
        "title": "Server never becomes ready",
        "text": "Example: an unavailable server starts but misses the default 60000ms readiness deadline."
      },
      "steps": [
        {
          "id": "probe-availability-reuse-require",
          "title": "Probe availability; reuse requires permission.",
          "text": "Probe availability; reuse requires permission.",
          "show": [
            "config",
            "probe"
          ],
          "current": [
            "probe"
          ],
          "edges": [],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "webServerPlugin.ts:96-102",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L96-L102"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "start-the-unavailable-server-and",
          "title": "Start the unavailable server and wait for readiness.",
          "text": "Start the unavailable server and wait for readiness.",
          "show": [
            "ready"
          ],
          "current": [
            "ready"
          ],
          "edges": [
            "probe_ready"
          ],
          "defs": [],
          "log": [],
          "sources": [
            {
              "label": "webServerPlugin.ts:72-89",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L72-L89"
            },
            {
              "label": "webServerPlugin.ts:194-209",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L194-L209"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "the-default-readiness-deadline-e",
          "title": "The default readiness deadline expires.",
          "text": "The default readiness deadline expires.",
          "show": [
            "ready"
          ],
          "current": [
            "ready"
          ],
          "edges": [],
          "defs": [],
          "log": [
            "Timed out waiting 60000ms from config.webServer."
          ],
          "sources": [
            {
              "label": "webServerPlugin.ts:194-209",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L194-L209"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        },
        {
          "id": "globalsetup-and-projects-never-s",
          "title": "GlobalSetup and projects never start; server cleanup runs.",
          "text": "GlobalSetup and projects never start; server cleanup runs.",
          "show": [
            "server"
          ],
          "current": [
            "server"
          ],
          "edges": [
            "ready_server"
          ],
          "defs": [],
          "log": [
            "Timed out waiting 60000ms from config.webServer."
          ],
          "sources": [
            {
              "label": "tasks.ts:156-162",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L156-L162"
            },
            {
              "label": "taskRunner.ts:63-83",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/taskRunner.ts#L63-L83"
            },
            {
              "label": "webServerPlugin.ts:72-89",
              "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L72-L89"
            }
          ],
          "deeper": [
            {
              "title": "4.2 Built on demand, torn down in reverse",
              "href": "/4-runner/4-2-custom-fixtures/"
            },
            {
              "title": "4.3 Workers take groups, shards keep them whole",
              "href": "/4-runner/4-3-workers-and-parallel/"
            }
          ]
        }
      ],
      "flow": [
        {
          "node": "probe",
          "step": "probe-availability-reuse-require",
          "log": []
        },
        {
          "node": "ready",
          "step": "start-the-unavailable-server-and",
          "log": [],
          "edge": "probe_ready"
        },
        {
          "node": "ready",
          "step": "the-default-readiness-deadline-e",
          "log": [
            "Timed out waiting 60000ms from config.webServer."
          ],
          "fail": true
        },
        {
          "node": "server",
          "step": "globalsetup-and-projects-never-s",
          "log": [],
          "edge": "ready_server"
        }
      ]
    }
  ],
  "definitions": {
    "config": {
      "term": "First defined retries",
      "text": "Retries select CLI, project, root configuration, then zero. Zero is defined."
    },
    "ready": {
      "term": "Server readiness",
      "text": "The runner plugin probes availability, starts an unavailable server and waits for readiness."
    },
    "global": {
      "term": "globalSetup",
      "text": "Runs after plugin setup and receives configuration; it can return cleanup."
    },
    "phase": {
      "term": "Project phases",
      "text": "A phase waits until dependencies and teardown-related setup consumers are processed."
    },
    "gate": {
      "term": "Success gate",
      "text": "Unsuccessful dependencies contribute no test groups; worker errors and non-OK tests prevent success."
    },
    "teardown": {
      "term": "Teardown project",
      "text": "Waits for setup and its consumers to be processed; it cannot have ordinary dependencies."
    },
    "returned": {
      "term": "Returned cleanup",
      "text": "A function returned from globalSetup is called during task teardown."
    },
    "server": {
      "term": "Reverse task cleanup",
      "text": "Task cleanup registers before setup and runs in reverse task order; server teardown terminates the process."
    }
  },
  "code": {
    "first": {
      "title": "Inside Playwright · util.ts",
      "source": {
        "label": "util.ts:379-379",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/util.ts#L379"
      },
      "lines": [
        "  for (const arg of args) {",
        "    if (arg !== undefined)",
        "      return arg;",
        "  }"
      ]
    },
    "gate": {
      "title": "Inside Playwright · tasks.ts",
      "source": {
        "label": "tasks.ts:451-451",
        "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451"
      },
      "lines": [
        "          const hasFailedDeps = project.deps.some(p => !successfulProjects.has(p));",
        "          if (!hasFailedDeps)",
        "            phaseTestGroups.push(...testGroups);"
      ]
    },
    "projects": {
      "title": "In your test · project edges",
      "lines": [
        "// ✗ Array order adds no dependency",
        "projects: [",
        "  { name: 'setup' },",
        "  { name: 'web' },",
        "],",
        "// ✓ Give web a setup dependency",
        "projects: [",
        "  { name: 'setup', teardown: 'clean' },",
        "  { name: 'web', dependencies: ['setup'] },",
        "  { name: 'clean' },",
        "],"
      ]
    }
  },
  "conceptScenario": "how",
  "concepts": [
    {
      "label": "Runner · configuration and run tasks",
      "layer": "runner",
      "items": [
        {
          "definition": "config",
          "short": "Zero counts as defined when selecting the first value.",
          "nodes": [
            "config"
          ],
          "step": {
            "step": "the-first-defined-retries-value"
          },
          "source": {
            "label": "util.ts:378-384",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/util.ts#L378-L384"
          }
        },
        {
          "definition": "ready",
          "short": "An available server is reused only when reuseExistingServer is enabled.",
          "nodes": [
            "probe",
            "ready"
          ],
          "step": {
            "step": "the-server-plugin-waits-for-read"
          },
          "source": {
            "label": "webServerPlugin.ts:96-102",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/plugins/webServerPlugin.ts#L96-L102"
          }
        },
        {
          "definition": "global",
          "short": "Receives configuration and may return a cleanup function.",
          "nodes": [
            "global"
          ],
          "step": {
            "step": "plugin-setup-precedes-globalsetu"
          },
          "source": {
            "label": "tasks.ts:213-223",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L213-L223"
          }
        }
      ]
    },
    {
      "label": "Runner · project phases",
      "layer": "test",
      "items": [
        {
          "definition": "phase",
          "short": "Phases wait for dependencies and teardown-related consumers to be processed.",
          "nodes": [
            "setup"
          ],
          "step": {
            "step": "dependencies-establish-project-p"
          },
          "source": {
            "label": "tasks.ts:382-398",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L382-L398"
          }
        },
        {
          "definition": "gate",
          "short": "Unsuccessful dependencies contribute no test groups.",
          "nodes": [
            "web"
          ],
          "step": {
            "step": "success-is-checked-separately"
          },
          "source": {
            "label": "tasks.ts:451-454",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L451-L454"
          }
        },
        {
          "definition": "teardown",
          "short": "A teardown project cannot have dependencies of its own.",
          "nodes": [
            "clean"
          ],
          "step": {
            "step": "teardown-waits-for-setup-and-its"
          },
          "source": {
            "label": "config.ts:265-278",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/common/config.ts#L265-L278"
          }
        }
      ]
    },
    {
      "label": "Runner · cleanup",
      "layer": "runner",
      "items": [
        {
          "definition": "returned",
          "short": "A returned globalSetup function runs during task teardown.",
          "nodes": [
            "returned"
          ],
          "step": {
            "step": "returned-globalsetup-cleanup-run"
          },
          "source": {
            "label": "tasks.ts:213-223",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/tasks.ts#L213-L223"
          }
        },
        {
          "definition": "server",
          "short": "Task cleanup registers before setup, in reverse task order.",
          "nodes": [
            "server"
          ],
          "step": {
            "step": "server-cleanup-runs-after-global"
          },
          "source": {
            "label": "taskRunner.ts:63-83",
            "url": "https://github.com/microsoft/playwright/blob/v1.65.0/packages/playwright/src/runner/taskRunner.ts#L63-L83"
          }
        }
      ]
    }
  ],
  "callouts": {
    "1": [
      "config"
    ],
    "2": [
      "setup",
      "web"
    ],
    "3": [
      "clean"
    ],
    "4": [
      "probe",
      "ready",
      "global",
      "returned",
      "server"
    ]
  },
  "deeper": [
    {
      "title": "4.2 Built on demand, torn down in reverse",
      "href": "/4-runner/4-2-custom-fixtures/",
      "why": "Fixture scopes and their teardown order."
    },
    {
      "title": "4.3 Workers take groups, shards keep them whole",
      "href": "/4-runner/4-3-workers-and-parallel/",
      "why": "How project test groups reach workers."
    }
  ],
  "viewBox": [
    420,
    616
  ]
}
