selenium grid 4 session queue stuck: how to debug
Shows how to debug a Selenium Grid 4 session queue that stops assigning sessions. Use it when tests wait forever for a Grid session. Not for single-node driver issues or Grid installation.
TL;DR
A stuck Grid 4 queue almost always means no node can satisfy the requested capabilities: browser version mismatch, wrong platform, or all slots busy with hung sessions. Check the Grid UI (or the /status endpoint) to compare queued requests against registered node stereotypes, then look for sessions that never released their slots. The fix is usually aligning browser versions, adding matching nodes, or killing orphaned sessions; raising queue timeouts only buys time.
The query
selenium grid 4 session queue stuck: how to debugUse this when
- Tests hang waiting for a Grid session
- The Grid UI shows a growing session queue
- New nodes register but the queue does not drain
- Sessions pile up after a deploy or browser upgrade
Not for
- Local (non-Grid) driver startup failures
- Grid installation or networking setup
- Test logic failures once a session is running
Steps
- Open the Grid UI or query
/statusand compare each queued request's capabilities against node stereotypes. Expected output: you see the mismatch (e.g. requests want Chrome 130, nodes offer Chrome 128) or that all slots are occupied. - List active sessions and find ones that are idle or orphaned (started long ago, no commands flowing). Expected output: a set of stale sessions holding slots.
- Delete orphaned sessions via the Grid API and align versions (update node browsers or pin requested versions). Expected output: slots free up and queued requests start matching nodes.
- Re-run and watch the queue drain; add alerts on queue depth so it does not silently stall again. Expected output: queue depth returns to near zero and stays there during a full run.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_3QCIinQXLs3vx2In4cOi0w
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.