{
  "slug": "playwright-test-runner-serializes-tests-sharing-a-named-lock-527d9fcf32e3",
  "title": "Playwright test runner serializes tests sharing a named lock",
  "tools": [
    "playwright"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-09-04T22:40:31.000Z",
  "announced_at": "2026-09-04T22:40:31.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When tests access a shared resource that cannot be used concurrently, give them the same named lock. Use `test.describe()` details to apply a lock to every test in a group; tests sharing a lock wait for one another while other tests can run in parallel.",
    "examples": [
      "import { test } from '@playwright/test';\n\ntest('update user settings', { lock: 'user-settings' }, async ({ page }) => {\n  // ...\n});",
      "import { test } from '@playwright/test';\n\ntest.describe('settings tests', { lock: 'user-settings' }, () => {\n  test('update settings', async ({ page }) => { /* ... */ });\n  test('reset settings', async ({ page }) => { /* ... */ });\n});"
    ],
    "gotchas": [
      "Version: v1.63.0",
      "test lock (`details.lock`): A lock name, or an array of lock names. Tests with a shared lock name do not run concurrently; a test with multiple locks runs only when all are available.",
      "test.describe() `title`: The group title; the API allows omitting it when using the callback form.",
      "test.describe() `details.lock`: A lock name or array of lock names applied to the group's tests. The docs do not state that lock names are mutually exclusive; multiple locks are supported.",
      "test.describe() `callback` (required): Function whose declared tests belong to the group.",
      "Prerequisite: Use Playwright Test v1.63.0 or later for test locks.",
      "Docs conflict: Current API docs mark `test.describe.configure({ lock })` as added in v1.64. That scope-level form is newer than v1.63.0; use the documented `test.describe()` details form for a group lock in this card’s version."
    ]
  },
  "why_it_matters": "Keep tests that access the same shared resource from running concurrently.",
  "sources": [
    "https://github.com/microsoft/playwright/releases/tag/v1.63.0",
    "https://playwright.dev/docs/test-parallel#test-locks",
    "https://playwright.dev/docs/api/class-test#test-describe"
  ],
  "rank": 0.98047,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "augsep-20261008",
    "verdict_id": "augsep-20261008:augsep-20261008-579bf8375159b0fd-0:gate",
    "evidence_hash": "8f458d0a9fe7d706ecdbbba7433f7d4b9f5359e0c90f3581627b8ce9e8b79bc6"
  },
  "review": {
    "draft_hash": "9967340035bb9d5391f050793bb5cfefcba16dfd18f8df7fa32135d28b04eee7",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "augsep-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.77 (>= 0.6 needed)."
  }
}
