Remote worker to listen to a specific port for Hazelcast

This change allows starting remote worker with an embedded hazelcast server that listens to
a specific port. This allows test to run reliably.

Fixes #1271.

--
Change-Id: I0bb36af5837f83cad3d76b8acb50f89cd599ee87
Reviewed-on: https://bazel-review.googlesource.com/c/3650/
MOS_MIGRATED_REVID=122829898
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
index 5ca8abf..4116a93 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteOptions.java
@@ -30,6 +30,16 @@
   public String hazelcastNode;
 
   @Option(
+    name = "hazelcast_standalone_listen_port",
+    defaultValue = "0",
+    category = "build_worker",
+    help =
+        "Runs an embedded hazelcast server that listens to this port. The server does not join"
+            + " any cluster. This is useful for testing."
+  )
+  public int hazelcastStandaloneListenPort;
+
+  @Option(
     name = "remote_worker",
     defaultValue = "null",
     category = "remote",