Skip to content

Commit

Permalink
[java][grid]: update test CustomNode can get/set sessionTimeout
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed May 6, 2024
1 parent bc16a30 commit 3548225
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 0 additions & 4 deletions java/src/org/openqa/selenium/grid/node/Node.java
Expand Up @@ -121,10 +121,6 @@ public abstract class Node implements HasReadyState, Routable {
private final Route routes;
protected boolean draining;

protected Node(Tracer tracer, NodeId id, URI uri, Secret registrationSecret) {
this(tracer, id, uri, registrationSecret, Duration.ofSeconds(300));
}

protected Node(
Tracer tracer, NodeId id, URI uri, Secret registrationSecret, Duration sessionTimeout) {
this.tracer = Require.nonNull("Tracer", tracer);
Expand Down
Expand Up @@ -164,6 +164,7 @@ void shouldBeAbleToRegisterACustomNode() throws URISyntaxException {
bus,
new NodeId(UUID.randomUUID()),
externalUrl.toURI(),
Duration.ofSeconds(300),
c ->
new Session(
new SessionId(UUID.randomUUID()), sessionUri, stereotype, c, Instant.now()));
Expand Down Expand Up @@ -193,6 +194,7 @@ void shouldBeAbleToRegisterACustomNode() throws URISyntaxException {

NodeStatus status = getOnlyElement(distributor.getStatus().getNodes());
assertEquals(1, getStereotypes(status).get(CAPS));
assertEquals(Duration.ofSeconds(300), status.getSessionTimeout());
}
}

Expand Down Expand Up @@ -375,8 +377,12 @@ static class CustomNode extends Node {
private Session running;

protected CustomNode(
EventBus bus, NodeId nodeId, URI uri, Function<Capabilities, Session> factory) {
super(DefaultTestTracer.createTracer(), nodeId, uri, registrationSecret);
EventBus bus,
NodeId nodeId,
URI uri,
Duration sessionTimeout,
Function<Capabilities, Session> factory) {
super(DefaultTestTracer.createTracer(), nodeId, uri, registrationSecret, sessionTimeout);

this.bus = bus;
this.factory = Objects.requireNonNull(factory);
Expand Down

0 comments on commit 3548225

Please sign in to comment.