[grid] Filter out reserved sessions while displaying in Grid UI. Display the ones with an actual session id only.
import org.openqa.selenium.grid.sessionqueue.NewSessionQueue;
import org.openqa.selenium.internal.Require;
import org.openqa.selenium.json.Json;
+import org.openqa.selenium.remote.SessionId;
import java.net.URI;
import java.util.ArrayList;
public class Grid {
private static final Json JSON = new Json();
+ private static final SessionId RESERVED = new SessionId("reserved");
private final URI uri;
private final DistributorStatus distributorStatus;
private final List<Set<Capabilities>> queueInfoList;
@@ -150,7 +152,7 @@ public int getSessionQueueSize() {
List<Session> sessions = new ArrayList<>();
for (NodeStatus status : distributorStatus.getNodes()) {
for (Slot slot : status.getSlots()) {
- if (slot.getSession()!=null) {
+ if (slot.getSession() != null && !slot.getSession().getId().equals(RESERVED)) {
org.openqa.selenium.grid.data.Session session = slot.getSession();
sessions.add(
new org.openqa.selenium.grid.graphql.Session(
