We were trying to get our jsunit tests running on the ci machine using firefox
running in xvfb. The tests seem to run fine but leave xvfb and the browser
running after the test completes. We tracked it down to the fact that the
browser kill command is not used because of the following line of code in the
suite method of StandaloneTest.
suite.addTest(new StandaloneTest(new
DelegatingConfigurationSource(originalSource) {
public String browserFileNames() {
return browser.getFileName();
}
}));
In the above code, browser.getFileName() has had the original kill command
stripped off.
When using firefox, this is not a problem because even if the kill command is
NULL, jsunit ends up destroying the firefox process via the java process object
in JsUnitStandardserver, like so:
if (browserProcess != null &&
configuration.shouldCloseBrowsersAfterTestRuns()) {
if (launchTestRunCommand.getBrowserKillCommand() != null) {
try {
processStarter.execute(new
String[]{launchTestRunCommand.getBrowserKillCommand()});
} catch (IOException e) {
e.printStackTrace();
}
} else {
browserProcess.destroy();
try {
browserProcess.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
waitUntilProcessHasExitValue(browserProcess);
}
}
Bottom line is-- we never see browser kill command executed. We always see
browserProcess.destroy() which does *not* work for us when we use xvfb.
Thanks,
Manish