Skip to content

Commit

Permalink
KristianRosenvold: Fixed test failure of testShouldGetMeaningfulExcep…
Browse files Browse the repository at this point in the history
…tionOnBrowserDeath

Killing firefox 3.5.19 does not work for 2.12.0 or 2.13.0, seemingly because the firefox launcher spawns another process

This test failure revealed a problem in the destroy logic on the new CommandLine implementation, which is fixed in this commit.
This error is mostly a problem of the tests and is not really expected to happen in 'live' code. Famous last words.

r14888
  • Loading branch information
krosenvold committed Nov 25, 2011
1 parent 0806d7c commit d1de0fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ android/libs
android/bin
android/local.properties
android/proguard.cfg
junit*.properties
WebDriver.suo
WebDriver.sln.cache
4 changes: 1 addition & 3 deletions java/client/src/org/openqa/selenium/os/CommandLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ public synchronized void start(Process process) {

@Override
public void stop() {
this.process = null;
super.stop();
}

Expand All @@ -335,7 +334,6 @@ public void reset() {

@Override
protected void cleanUp() {
this.process = null;
super.cleanUp();
}

Expand Down Expand Up @@ -367,7 +365,7 @@ private void waitForTerminationAfterDestroy(int duration, TimeUnit unit) {
private void destroyHarder() {
log.info("Command failed to close cleanly. Destroying forcefully (v2). " + this);
Process ourProc = process;
if (ourProc != null) ProcessUtils.killProcess(ourProc);
ProcessUtils.killProcess(ourProc);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.openqa.selenium.ParallelTestRunner;
import org.openqa.selenium.ParallelTestRunner.Worker;
import org.openqa.selenium.Platform;
import org.openqa.selenium.TestUtilities;
import org.openqa.selenium.UnhandledAlertException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
Expand Down Expand Up @@ -89,9 +90,14 @@ protected ExtensionConnection connectTo(FirefoxBinary binary, FirefoxProfile pro
}

public void testShouldGetMeaningfulExceptionOnBrowserDeath() {
if (TestUtilities.isFirefox35(driver)){
// This test does not work on firefox 3.5.19 on linux. Seems to be related to 3.5.19 forking child process
return;
}
ConnectionCapturingDriver driver2 = new ConnectionCapturingDriver();
driver2.get(pages.formPage);


try {
driver2.keptConnection.quit();
driver2.get(pages.formPage);
Expand Down

0 comments on commit d1de0fd

Please sign in to comment.