From 75d4eaf786947a3376de3aa78d3c8db67f10f3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sautter?= Date: Fri, 1 Mar 2024 17:01:37 +0100 Subject: [PATCH] [java] ensure the original RemoteNode stays DOWN #13646 --- .../org/openqa/selenium/grid/node/remote/RemoteNode.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/src/org/openqa/selenium/grid/node/remote/RemoteNode.java b/java/src/org/openqa/selenium/grid/node/remote/RemoteNode.java index 43f0e20efaff1..dccbb0d5d5a5c 100644 --- a/java/src/org/openqa/selenium/grid/node/remote/RemoteNode.java +++ b/java/src/org/openqa/selenium/grid/node/remote/RemoteNode.java @@ -279,6 +279,12 @@ public Result check() { try { NodeStatus status = getStatus(); + if (!Objects.equals(getId(), status.getNodeId())) { + // ensure the original RemoteNode stays DOWN when it has been restarted and registered + // again as another RemoteNode with the same externalUri + return new Result(DOWN, externalUri + " has unexpected node id"); + } + switch (status.getAvailability()) { case DOWN: return new Result(DOWN, externalUri + " is down");