Skip to content

Commit 01b672e

Browse files
committed
[grid] Filter out reserved sessions while displaying in Grid UI. Display the ones with an actual session id only.
1 parent 8345a87 commit 01b672e

File tree

1 file changed

+3
-1
lines changed
  • java/src/org/openqa/selenium/grid/graphql

1 file changed

+3
-1
lines changed

java/src/org/openqa/selenium/grid/graphql/Grid.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.openqa.selenium.grid.sessionqueue.NewSessionQueue;
2929
import org.openqa.selenium.internal.Require;
3030
import org.openqa.selenium.json.Json;
31+
import org.openqa.selenium.remote.SessionId;
3132

3233
import java.net.URI;
3334
import java.util.ArrayList;
@@ -41,6 +42,7 @@
4142
public class Grid {
4243

4344
private static final Json JSON = new Json();
45+
private static final SessionId RESERVED = new SessionId("reserved");
4446
private final URI uri;
4547
private final DistributorStatus distributorStatus;
4648
private final List<Set<Capabilities>> queueInfoList;
@@ -150,7 +152,7 @@ public List<Session> getSessions() {
150152
List<Session> sessions = new ArrayList<>();
151153
for (NodeStatus status : distributorStatus.getNodes()) {
152154
for (Slot slot : status.getSlots()) {
153-
if (slot.getSession()!=null) {
155+
if (slot.getSession() != null && !slot.getSession().getId().equals(RESERVED)) {
154156
org.openqa.selenium.grid.data.Session session = slot.getSession();
155157
sessions.add(
156158
new org.openqa.selenium.grid.graphql.Session(

0 commit comments

Comments
 (0)