Skip to content

Commit 3548225

Browse files
committed
[java][grid]: update test CustomNode can get/set sessionTimeout
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent bc16a30 commit 3548225

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

java/src/org/openqa/selenium/grid/node/Node.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ public abstract class Node implements HasReadyState, Routable {
121121
private final Route routes;
122122
protected boolean draining;
123123

124-
protected Node(Tracer tracer, NodeId id, URI uri, Secret registrationSecret) {
125-
this(tracer, id, uri, registrationSecret, Duration.ofSeconds(300));
126-
}
127-
128124
protected Node(
129125
Tracer tracer, NodeId id, URI uri, Secret registrationSecret, Duration sessionTimeout) {
130126
this.tracer = Require.nonNull("Tracer", tracer);

java/test/org/openqa/selenium/grid/distributor/AddingNodesTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ void shouldBeAbleToRegisterACustomNode() throws URISyntaxException {
164164
bus,
165165
new NodeId(UUID.randomUUID()),
166166
externalUrl.toURI(),
167+
Duration.ofSeconds(300),
167168
c ->
168169
new Session(
169170
new SessionId(UUID.randomUUID()), sessionUri, stereotype, c, Instant.now()));
@@ -193,6 +194,7 @@ void shouldBeAbleToRegisterACustomNode() throws URISyntaxException {
193194

194195
NodeStatus status = getOnlyElement(distributor.getStatus().getNodes());
195196
assertEquals(1, getStereotypes(status).get(CAPS));
197+
assertEquals(Duration.ofSeconds(300), status.getSessionTimeout());
196198
}
197199
}
198200

@@ -375,8 +377,12 @@ static class CustomNode extends Node {
375377
private Session running;
376378

377379
protected CustomNode(
378-
EventBus bus, NodeId nodeId, URI uri, Function<Capabilities, Session> factory) {
379-
super(DefaultTestTracer.createTracer(), nodeId, uri, registrationSecret);
380+
EventBus bus,
381+
NodeId nodeId,
382+
URI uri,
383+
Duration sessionTimeout,
384+
Function<Capabilities, Session> factory) {
385+
super(DefaultTestTracer.createTracer(), nodeId, uri, registrationSecret, sessionTimeout);
380386

381387
this.bus = bus;
382388
this.factory = Objects.requireNonNull(factory);

0 commit comments

Comments
 (0)