Skip to content

Commit 14eecce

Browse files
committed
[grid] Node capacity is given by available slots and usage below maxSessions.
1 parent 9249e31 commit 14eecce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

java/src/org/openqa/selenium/grid/data/NodeStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public boolean hasCapability(Capabilities caps) {
136136
}
137137

138138
public boolean hasCapacity() {
139-
return slots.stream().anyMatch(slot -> slot.getSession() == null);
139+
return slots.stream().filter(slot -> slot.getSession() != null).count() < maxSessionCount;
140140
}
141141

142142
// Check if the Node's max session limit is not exceeded and has a free slot that supports the capability.

0 commit comments

Comments
 (0)