diff --git a/.gitignore b/.gitignore index c63874bc803b1..83dba147052e9 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ java/client/src/org/openqa/selenium/ie/IeReturnTypes.java .idea/misc.xml .idea/workspace.xml .idea/projectCodeStyle.xml +.idea/* out cpp/IEDriver/sizzle.h third_party/gecko-2/linux diff --git a/java/server/src/org/openqa/grid/selenium/proxy/WebRemoteProxy.java b/java/server/src/org/openqa/grid/selenium/proxy/WebRemoteProxy.java index 0c10794446e26..1e326d727b98f 100644 --- a/java/server/src/org/openqa/grid/selenium/proxy/WebRemoteProxy.java +++ b/java/server/src/org/openqa/grid/selenium/proxy/WebRemoteProxy.java @@ -86,9 +86,8 @@ public HtmlRenderer getHtmlRender() { /* * Self Healing part.Polls the remote, and marks it down if it cannot be reached twice in a row. */ - private boolean down = false; - private boolean poll = true; - int nbFailedPoll = 0; + private volatile boolean down = false; + private volatile boolean poll = true; // TODO freynaud private List errors = new CopyOnWriteArrayList(); private Thread pollingThread = null; @@ -113,6 +112,8 @@ public boolean isAlive() { public void startPolling() { pollingThread = new Thread(new Runnable() { + int nbFailedPoll = 0; + public void run() { while (poll) { try { diff --git a/java/server/test/org/openqa/grid/e2e/wd/WebDriverPriorityDemo.java b/java/server/test/org/openqa/grid/e2e/wd/WebDriverPriorityDemo.java index f98ee294980c4..6a06c4a50cb6f 100644 --- a/java/server/test/org/openqa/grid/e2e/wd/WebDriverPriorityDemo.java +++ b/java/server/test/org/openqa/grid/e2e/wd/WebDriverPriorityDemo.java @@ -88,7 +88,7 @@ public void test() throws MalformedURLException, InterruptedException { @Test(dependsOnMethods = "test") public void sendMoreRequests() throws MalformedURLException { for (int i = 0; i < 5; i++) { - new Thread(new Runnable() { + new Thread(new Runnable() { // Thread safety reviewed public void run() { DesiredCapabilities ff = DesiredCapabilities.firefox(); try { @@ -101,8 +101,8 @@ public void run() { } } - WebDriver importantOne; - boolean importantOneStarted = false; + volatile WebDriver importantOne; + volatile boolean importantOneStarted = false; // adding a request with high priority at the end of the queue @Test(dependsOnMethods = "sendMoreRequests", timeOut = 30000) @@ -117,7 +117,7 @@ public void sendTheImportantOne() throws MalformedURLException, InterruptedExcep final DesiredCapabilities ff = DesiredCapabilities.firefox(); ff.setCapability("_important", true); - new Thread(new Runnable() { + new Thread(new Runnable() { // Thread safety reviewed public void run() { try { importantOne = new RemoteWebDriver(new URL(hubURL + "/grid/driver"), ff); @@ -135,7 +135,7 @@ public void run() { @Test(dependsOnMethods = "sendTheImportantOne") public void sendMoreRequests2() throws MalformedURLException { for (int i = 0; i < 5; i++) { - new Thread(new Runnable() { + new Thread(new Runnable() { // Thread safety reviewed public void run() { DesiredCapabilities ff = DesiredCapabilities.firefox(); try {