diff --git a/java/src/org/openqa/selenium/grid/data/NodeStatus.java b/java/src/org/openqa/selenium/grid/data/NodeStatus.java index 0b2f63752954a..c9ce38614fcea 100644 --- a/java/src/org/openqa/selenium/grid/data/NodeStatus.java +++ b/java/src/org/openqa/selenium/grid/data/NodeStatus.java @@ -214,7 +214,8 @@ public boolean equals(Object o) { return Objects.equals(this.nodeId, that.nodeId) && Objects.equals(this.externalUri, that.externalUri) && this.maxSessionCount == that.maxSessionCount - && this.sessionTimeout == that.sessionTimeout + && this.sessionTimeout.compareTo(that.sessionTimeout) == 0 + && this.heartbeatPeriod.compareTo(that.heartbeatPeriod) == 0 && Objects.equals(this.slots, that.slots) && Objects.equals(this.availability, that.availability) && Objects.equals(this.version, that.version); diff --git a/java/src/org/openqa/selenium/grid/router/GridStatusHandler.java b/java/src/org/openqa/selenium/grid/router/GridStatusHandler.java index 1bd9dd1614ad3..b1fb021cf59a9 100644 --- a/java/src/org/openqa/selenium/grid/router/GridStatusHandler.java +++ b/java/src/org/openqa/selenium/grid/router/GridStatusHandler.java @@ -135,7 +135,19 @@ public HttpResponse execute(HttpRequest req) { List> nodeResults = status.getNodes().stream() - .map(node -> new ImmutableMap.Builder().putAll(node.toJson()).build()) + .map( + node -> + new ImmutableMap.Builder() + .put("id", node.getNodeId()) + .put("uri", node.getExternalUri()) + .put("maxSessions", node.getMaxSessionCount()) + .put("sessionTimeout", node.getSessionTimeout().toMillis()) + .put("osInfo", node.getOsInfo()) + .put("heartbeatPeriod", node.getHeartbeatPeriod().toMillis()) + .put("availability", node.getAvailability()) + .put("version", node.getVersion()) + .put("slots", node.getSlots()) + .build()) .collect(toList()); ImmutableMap.Builder value = ImmutableMap.builder(); diff --git a/java/test/org/openqa/selenium/grid/distributor/local/LocalDistributorTest.java b/java/test/org/openqa/selenium/grid/distributor/local/LocalDistributorTest.java index 41b0beeffb41a..3ce2fe80d8352 100644 --- a/java/test/org/openqa/selenium/grid/distributor/local/LocalDistributorTest.java +++ b/java/test/org/openqa/selenium/grid/distributor/local/LocalDistributorTest.java @@ -103,6 +103,7 @@ public void setUp() throws URISyntaxException { .add(caps, new TestSessionFactory((id, c) -> new Handler(c))) .maximumConcurrentSessions(2) .sessionTimeout(Duration.ofSeconds(30)) + .heartbeatPeriod(Duration.ofSeconds(5)) .build(); wait = @@ -145,6 +146,7 @@ void testAddNodeToDistributor() { assertThat(distributorNode.getNodeId()).isEqualByComparingTo(localNode.getId()); assertThat(distributorNode.getExternalUri()).isEqualTo(uri); assertThat(distributorNode.getSessionTimeout()).isEqualTo(Duration.ofSeconds(30)); + assertThat(distributorNode.getHeartbeatPeriod()).isEqualTo(Duration.ofSeconds(5)); } @Test diff --git a/java/test/org/openqa/selenium/grid/gridui/OverallGridTest.java b/java/test/org/openqa/selenium/grid/gridui/OverallGridTest.java index 586230b88a402..b508370e27b20 100644 --- a/java/test/org/openqa/selenium/grid/gridui/OverallGridTest.java +++ b/java/test/org/openqa/selenium/grid/gridui/OverallGridTest.java @@ -68,7 +68,7 @@ public void tearDown() { @Test void shouldReportConcurrencyZeroPercentWhenGridIsStartedWithoutLoad() { - driver.get(whereIs(server, "/ui#/sessions")); + driver.get(whereIs(server, "/ui/#/sessions")); WebElement concurrency = wait.until( @@ -79,7 +79,7 @@ void shouldReportConcurrencyZeroPercentWhenGridIsStartedWithoutLoad() { @Test void shouldShowOneNodeRegistered() { - driver.get(whereIs(server, "/ui")); + driver.get(whereIs(server, "/ui/")); List nodeInfoIcons = wait.until( @@ -93,7 +93,7 @@ void shouldIncrementSessionCountWhenSessionStarts() { WebDriver remoteWebDriver = new RemoteWebDriver(server.getUrl(), Browser.detect().getCapabilities()); try { - driver.get(whereIs(server, "/ui#/sessions")); + driver.get(whereIs(server, "/ui/#/sessions")); wait.until(textToBe(By.cssSelector("div[data-testid='session-count']"), "1")); } finally {