The unit is the worker, not the scenario.
A lease is owned by runId:shardOffset+parallelIndex. The first scenario on a worker that needs a standard account takes one; the worker holds it for the rest of its life and releases at teardown. So the number of accounts with a role is a hard cap on how many workers can run that role's scenarios concurrently — four accounts, eight workers, four workers wait and then fail.
That is the right model when scenarios mutate user-scoped state, which is the common case: two workers on one identity see each other's carts, sessions and sign-outs. Sharing accounts turns a passing suite into a flaky one and the failures look like application bugs.
Three ways out, in the order I would try them:
- Seed more accounts with that role. The account count is a capacity number now — plan it like one.
- Cap
-w at the number of accounts for your busiest role. - Split the role's scenarios into their own run with its own worker count, and let the rest of the suite run wide.
One thing to know before you go to CI with sharding: the owner key includes a shard offset so two shards never generate the same owner string. With leaseStore: file each machine has its own lease directory anyway, so three shards at four workers each need twelve accounts, not four. With leaseStore: db they contend for the same rows and the arithmetic is the same.