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");