← blog
· series: Measured

Playwright 1.65: A Filter That Matches Nothing Now Fails Every Shard

1,464 runs on Playwright 1.64.1 and 1.65.1. A sharded run with zero matching tests went from all green to all red. Empty shards still pass. One flag still slips through.

Playwright 1.65 has one line in its notable changes that reads like a small tidy-up: a sharded run now fails with "No tests found" when no tests match across all shards. If your CI builds a --grep or a path filter per pull request and fans it out over a shard matrix, that line decides whether a pull request that touches no tests is green or red.

I ran the same suite on 1.64.1 and 1.65.1 to see exactly which cases changed. The harness and raw results are in the PoC repo.

The setup

That is 1,464 runs. I recorded the exit code of every run and the number of tests it ran. A second script runs four real filters that can match nothing.

The numbers

Zero selected tests, failed shards out of all shards:

Version--pass-with-no-testsUnsharded2 shards4 shards8 shards16 shards
1.64.1no1/10/20/40/80/16
1.64.1yes0/10/20/40/80/16
1.65.1no1/12/24/48/816/16
1.65.1yes0/10/20/40/80/16

On 1.64.1, sharding hid the error. The unsharded run failed with "No tests found" and the same filter with --shard passed on every shard. On 1.65.1 the sharded run agrees with the unsharded one: every shard fails.

No other exit code changed. A job here is one cell of the matrix with all of its shards. With 1 to 16 selected tests, all 180 jobs had 0 failed shards on both versions, even when 15 of 16 shards had no test to run. An empty shard is still fine. A whole run with no tests is not.

Which filters hit it

The same check with four filters, as shards 1/2 and 2/2, without the flag:

Filter1.64.1 unsharded1.64.1 sharded1.65.1 unsharded1.65.1 sharded
--grep matches nothingfails0/2 failfails2/2 fail
Path filter matches nothingfails0/2 failfails2/2 fail
--last-failed after a green runfails0/2 failfails0/2 fail
--only-changed, no test file changedpasses0/2 failpasses0/2 fail

For --last-failed, the last run file from the green run was still on disk, as it is when CI restores it from a cache or an artifact.

Two results here are not in the release note:

The balancer

playwright-shard-balancer plans shards through Playwright's preprocess hook, so I checked whether a shard it leaves empty trips the new rule. It does not. Version 0.1.3 gave the same exit code as Playwright's split in every cell: all shards fail on a zero-test selection, and none fail when at least one test is selected. The balancer did plan differently: it left a different number of shards empty in 36 of the paired jobs.

What I'd change in CI