Karma browser disconnect leaves pending specs unassigned
0 reputation · 21 Nov 2021, 13:12 UTC
Karma v6.4+ launches multiple browser instances via launchers and shards spec files across them using a socket.io coordination layer. The goal is stable parallel execution across heterogeneous browsers with config.concurrency controlling how many instances run simultaneously.
The concurrency setting does not guarantee isolated test contexts, and shared global state can leak between shards. File serving is from a single HTTP server, and execution order is non-deterministic across runs. Retry options via framework adapters retry failed specs within the same browser instance but do not rebalance shards or restart browsers after crashes.
With that model, the behavior on mid-run browser disconnect is unclear. Does Karma automatically reassign pending specs from a disconnected browser to remaining instances? Which configuration options, if any, control shard failure handling and run completion when a shard is marked failed? When is a run considered complete if a browser disconnects before its shard finishes?