·12 min read
Playwright locks stop at the shard. One server per shard.
A Playwright test lock only sees its own run. See two shards break one shared server, then two fixes that passed in a demo on 1.65.1.

Published: · 9 min read
Opus 5.5 wrote correct code in 12 of 12 runs, so a fresh spec-only test session found no real bug. With planted bugs, it caught one the builder's tests missed.
On this page
When one AI session writes the code and its tests, it reads the spec once. The spec is the written rules for the code. If the session misreads a rule, its tests can repeat the mistake. One tip: ask a second agent, a fresh session, for the tests. That session sees only the spec, never the code.
The idea now has a product, too. On November 20, TestSprite released version 4.0. Its press release calls it "an independent testing agent". It checks software apart from the person or coding agent that wrote it. This article doesn't test TestSprite. It tries the do-it-yourself version of the idea, with a tool you may already use.
The demo ran 24 Claude Code sessions on four small specs. Here is the short answer. Opus 5.5 wrote correct code every time, so the second session found no real bug. There was none to find.
Then a second check planted bugs on purpose in a separate version of the code. The builder's own tests missed one of them, in all three runs. The checker's tests caught it. Reading the builders' real tests showed something else: guesses that became rules. I'd add a second session where a bug costs money or trust. For code a quick read can check, I'd skip it.
Session A is the builder. It reads the spec, writes the code, then writes tests and runs them. Session B is the checker. It starts fresh, in a folder that holds only the spec.
Then B's tests run against A's code. A failing test means the two disagree. Either the code has a bug, the test is wrong, or the spec is unclear. Each one is worth knowing before a user finds it.
Each spec is a few plain rules, with tricky cases code often gets wrong:
Here is the password spec, exactly as both sessions saw it:
# Password rule
Write `isValidPassword(password, username)` in `src/password.mjs`, as a named export. It returns `true` or `false`.
A password is valid when all of these hold:
- It is 12 to 64 characters long. Count characters as Unicode code points, so an emoji such as 🔒 counts as one character.
- It contains at least one letter and at least one digit.
- It does not start or end with whitespace.
- It does not contain the username, ignoring case. This rule applies only when the username is 3 or more characters long.
node:test is the test runner built into Node.js, so nothing needs installing. The builder got this prompt:
Read SPEC.md and implement it. Then write tests for it with node:test in a test/ folder, run them with node --test, and make sure they all pass.
The checker got this one, in its own folder:
Read SPEC.md. Someone else is implementing it, and you can't see their code. Write tests for it with node:test in a test/ folder, based only on the spec. Don't write the implementation.
Every session was a headless Claude Code run, started with claude -p. Headless means no chat window. They all used Opus 5.5, with Claude Code's effort setting on high. The --safe-mode flag turned off instruction files, plugins and MCP servers, which connect extra tools. So no instruction file, plugin or MCP server shaped the results.
Each spec ran three times on each side: 24 sessions in all. All 12 checker sessions ran first, so no builder code existed yet. Eleven checkers wrote a throwaway version in their own scratch folder, to try their tests. None of it reached the spec folder. Permission prompts were skipped, so a session could touch any file. The steps in "Try it" use a short tool list instead.
The results were judged against a reference version of each spec. The Claude Code session that set up the demo wrote it. Think of it as an answer key. It came with 69 checks where the specs give a clear answer. The specs leave 15 more cases open. Those were reported, but never counted as bugs.
All 12 builder versions passed every check for their spec. Their own tests passed, too.
The checker's tests also passed on the builder's code, in 12 of 12 runs. Not one test disagreed. On these four specs, the second session reported no bug, because there was none.
So these small, clear specs were easy for a strong model. Opus 5.5 got the half cent, the impossible dates and the emoji length right.
With no real bugs, the next question was simple. If the code were wrong, which tests would notice?
So the setup session planted 26 bugs, one at a time, into the reference versions. They are small, typical edits. Some turn >= into >. Others change the rounding, skip a check or count length the wrong way. Each set of tests then ran against each planted bug.
This is a second check, not the main result. The bugs were planted in the reference code, not in the builder's code. They show what each set of tests can catch. They say nothing about how often agents make these mistakes.
| Spec | Tests written, builder | Tests written, checker | Planted bugs caught, builder's tests | Planted bugs caught, checker's tests |
|---|---|---|---|---|
| Order discount | 28 | 134 | 21 of 21 | 21 of 21 |
| Booking overlap | 82 | 173 | 18 of 18 | 18 of 18 |
| Page info | 72 | 173 | 18 of 18 | 18 of 18 |
| Password rule | 42 | 195 | 18 of 21 | 21 of 21 |
| Total | 224 | 675 | 75 of 78 | 78 of 78 |
Test counts are totals across three runs. A planted bug counts once per run, so 26 bugs make 78 chances per side.
All three misses were the same planted bug, once in each run. It checks the username as a pattern instead of as plain text:
if (new RegExp(username, 'i').test(password)) return false;
A regular expression, or regex, is a search pattern. In a regex, a dot matches any character. So the username a.c also matches abc, and a good password like abcdefghijk1 gets rejected.
The builder's code didn't have this bug. All three builder versions checked the username with plain text search:
if (password.toLowerCase().includes(username.toLowerCase())) return false;
So the builder never tested a username with a dot. For the code it wrote, such a test could never fail. The checker couldn't see the code, so it planned for code it might get. All three checker test files tested a dot in the username. Here is one:
it('treats the username literally, not as a regex pattern', () => {
valid('abcdefghijk1', 'a.c'); // "a.c" is not a literal substring
invalid('xxa.cxx12345', 'a.c');
valid('abcdefghijk1', '.*.');
});
This is the part I find most useful. The builder's tests fit the code it has today. The checker's tests also fit the code someone might write next month. Imagine a teammate later swaps includes for a regex. Only the checker's test would catch it.
This one is in the builders' real tests, not in a planted bug. The spec says a password needs "at least one letter." It doesn't say whether é or п counts.
All three builder sessions picked yes. Then each wrote a test that makes it a rule:
test('non-ASCII letters count as letters', () => ok('пароль123456'));
Yes is a fair reading. But it's a guess, and the test makes the guess look like the spec. If the owner meant only a to z, the test defends the wrong code.
To be fair, every builder noticed the gap. Each one named its choice in its final reply. One said a to z only meant changing "two patterns" and "the matching tests." But the test file still treats the guess as settled.
The letter rule was not the only guess. All three builders also locked in three more open points. They were a leading non-breaking space, a missing username and a username's length.
The three checkers made a different choice. Each left those rules untested and listed them as open questions. One headed its list "Not tested, because the spec doesn't settle them". That list is worth reading. It's a ready-made set of questions for whoever owns the spec.
The checker writes more tests and takes longer:
More tests are not better tests on their own. Someone still reads them, runs them and keeps them up to date. Here, every extra test passed on correct code, so none gave a false alarm. On a messier spec, expect some to be wrong.
You need Node.js 22 or later and Claude Code. The demo ran Node.js 24.22.2 and Claude Code 2.1.332 on macOS. Put your spec in SPEC.md. Name the file and the function in it, like the password spec does. Then run this from the same folder:
mkdir -p demo/app demo/spec-only
cp SPEC.md demo/app/
cp SPEC.md demo/spec-only/
# 1. The checker: a fresh session that sees only the spec
cd demo/spec-only
claude -p "Read SPEC.md. Someone else is implementing it, and you can't see their code. Write tests for it with node:test in a test/ folder, based only on the spec. Don't write the implementation." --allowedTools "Read,Write,Edit"
# 2. The builder: the code and its own tests
cd ../app
claude -p "Read SPEC.md and implement it. Then write tests for it with node:test in a test/ folder, run them with node --test, and make sure they all pass." --allowedTools "Read,Write,Edit,Bash(node *)"
# 3. Run the checker's tests against the builder's code
mkdir test-spec
cp ../spec-only/test/*.mjs test-spec/
node --test test-spec/*.mjs
--allowedTools gives each session only the tools it needs. Then no permission prompt stops it. Keep the prompt right after -p. --allowedTools takes a list. When it came first, it read the prompt as part of that list. The run then stopped with this error (-p is short for --print):
Error: Input must be provided either through stdin or as a prompt argument when using --print
To match the demo, add --model claude-opus-5-5 --effort high --safe-mode to each claude line. The steps were tested once that way, on the password spec. Your agent may name its files differently. If the copy step finds no test file, check the checker's folder first.
The second agent found no real bug this time, because the code had none. Its value showed up in two other places. With planted bugs, its tests caught a regex mistake the builder's tests missed. And it kept unclear rules open, instead of turning guesses into tests.
Anton Gulin is the AI QA Architect, the first person to claim this title on LinkedIn. He builds AI-powered test automation systems where AI agents and human engineers collaborate on quality. Former Apple SDET (Apple.com / Apple Card pre-release testing). Find him at anton.qa or on LinkedIn.
Get notified when I publish something new, and unsubscribe at any time.
·12 min read
A Playwright test lock only sees its own run. See two shards break one shared server, then two fixes that passed in a demo on 1.65.1.

·16 min read
Playwright 1.65 lists ten changes that can fail your tests. See each real error after the upgrade, and a fix that worked in a demo.

·10 min read
Playwright 1.65 adds a lock that runs one test alone. See a demo where a server restart breaks three tests, and how the lock fixes it.
