docs/solutions/test-failures/2026-04-24-slate-v2-integration-local-should-cap-local-playwright-workers-before-debugging-editor-failures.md
bun test:integration-local can fail for two different reasons in the same run:
a real editor ownership bug and local Playwright saturation. Do not treat those
as the same failure.
page.goto.0.First fix the real ownership bug. Structural Enter input must be classified as model-owned before command dispatch:
const classifyKeyboardIntent = (event: KeyboardEvent): InputIntent => {
if (Hotkeys.isSoftBreak(event) || Hotkeys.isSplitBlock(event)) {
return 'insert-break'
}
// other keyboard intent classification
}
Then make the local integration harness deterministic instead of maximizing parallelism:
const workers = process.env.PLAYWRIGHT_WORKERS
? +process.env.PLAYWRIGHT_WORKERS
: process.env.CI
? undefined
: 2
const config: PlaywrightTestConfig = {
timeout: 30 * 1000,
workers,
}
Keep PLAYWRIGHT_WORKERS as an explicit override for focused local probes. Do
not change CI worker policy unless CI proves the same saturation shape.
The kernel assertion separates editor authority bugs from browser-harness noise. Enter/split-block is structural editing, so it belongs to the model-owned command path.
The local Playwright cap fixes a different problem: static exported examples
plus four browser projects can starve page loads when local workers are
unrestricted. Lower local parallelism produces cleaner release evidence. Perf
pressure belongs to the dedicated React/core benchmarks, not to
page.goto timing in integration rows.
page.goto, reduce local workers
before debugging editor code.bun test:integration-local as release-clean when it exits 0
but reports flaky rows.--workers=4 --retries=0 or an
intentional PLAYWRIGHT_WORKERS override.