From 82277abbe5796d61ee6e7336802fd99e92eb4543 Mon Sep 17 00:00:00 2001 From: joerg1985 <16140691+joerg1985@users.noreply.github.com> Date: Tue, 26 Mar 2024 07:19:59 +0100 Subject: [PATCH] [java] ensure the original RemoteNode stays DOWN #13646 (#13647) --- .../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");