Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Commit

Permalink
Setting amount of executed tests to maximum allowed when the node is … (
Browse files Browse the repository at this point in the history
#464)

* Setting amount of executed tests to maximum allowed when the node is shutting down, fixes #426

* Removing unused method in Registry

* Updating Ubuntu base image
  • Loading branch information
diemol authored Mar 7, 2018
1 parent feb800d commit b8dc91f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> requestedCapability, String capabilityName, String defaultValue) {
return Optional.ofNullable(requestedCapability.get(capabilityName)).orElse(defaultValue).toString();
}
Expand Down Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit b8dc91f

Please sign in to comment.