diff --git a/docker/Dockerfile b/docker/Dockerfile index 4a33d965e6..941c8588ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,9 @@ #== Ubuntu xenial is 16.04, i.e. FROM ubuntu:16.04 # Find latest images at https://hub.docker.com/r/library/ubuntu/ # Layer size: big: ~130 MB -FROM ubuntu:xenial-20180123 +FROM ubuntu:xenial-20180228 ENV UBUNTU_FLAVOR="xenial" \ - UBUNTU_DATE="20180123" + UBUNTU_DATE="20180228" #== Ubuntu flavors - common RUN echo "deb http://archive.ubuntu.com/ubuntu ${UBUNTU_FLAVOR} main universe\n" > /etc/apt/sources.list \ diff --git a/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java b/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java index 9dfa131003..78c8c907da 100644 --- a/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java +++ b/src/main/java/de/zalando/ep/zalenium/proxy/DockerSeleniumRemoteProxy.java @@ -321,6 +321,15 @@ private synchronized boolean increaseCounter() { return true; } + /* + When we shutdown the node because a test finished with a timeout, then we also set the test counter to the + max amount, otherwise there is a risk where a test is accepted while the node is shutting down. + This should only be invoked from the shutdownNode() method when the test had been idle. + */ + private synchronized void stopReceivingTests() { + amountOfExecutedTests = maxTestSessions; + } + private String getCapability(Map requestedCapability, String capabilityName, String defaultValue) { return Optional.ofNullable(requestedCapability.get(capabilityName)).orElse(defaultValue).toString(); } @@ -545,6 +554,7 @@ private void shutdownNode(boolean isTestIdle) { if (isTestIdle) { terminateIdleTest(); + stopReceivingTests(); shutdownReason = String.format("%s Marking the node as down because the test has been idle for more than %s seconds.", getId(), getMaxTestIdleTimeSecs()); } diff --git a/src/main/java/de/zalando/ep/zalenium/registry/ZaleniumRegistry.java b/src/main/java/de/zalando/ep/zalenium/registry/ZaleniumRegistry.java index 155efa4172..cabc52d304 100644 --- a/src/main/java/de/zalando/ep/zalenium/registry/ZaleniumRegistry.java +++ b/src/main/java/de/zalando/ep/zalenium/registry/ZaleniumRegistry.java @@ -57,16 +57,6 @@ public ZaleniumRegistry(Hub hub) { this.matcherThread.setUncaughtExceptionHandler(new UncaughtExceptionHandler()); } - /** - * Creates a new {@link GridRegistry} that is not associated with a Hub and starts it. - * - * @return the registry - */ - @SuppressWarnings({"NullableProblems"}) - public static GridRegistry newInstance() { - return newInstance(null); - } - /** * Creates a new {@link GridRegistry} and starts it. *