Fix undeterministic web test failures
Problem 1: No network interface
Maybe caused by timeout of 45 seconds in the webdriver which was exceeded by slow tomcat startup. Increase to 90 sec? (not sure how yet)
Jul 04, 2013 1:21:08 PM org.openqa.selenium.net.NetworkInterface <init> WARNING: null java.net.SocketException: No such device at java.net.NetworkInterface.isLoopback0(Native Method) at java.net.NetworkInterface.isLoopback(NetworkInterface.java:390) at org.openqa.selenium.net.NetworkInterface.<init>(NetworkInterface.java:41) at org.openqa.selenium.net.DefaultNetworkInterfaceProvider.createInterface(DefaultNetworkInterfaceProvider.java:75) at org.openqa.selenium.net.DefaultNetworkInterfaceProvider.<init>(DefaultNetworkInterfaceProvider.java:51) at org.openqa.selenium.net.NetworkUtils.<init>(NetworkUtils.java:34) at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.<clinit>(NewProfileExtensionConnection.java:47) at org.openqa.selenium.firefox.FirefoxDriver.connectTo(FirefoxDriver.java:271) at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:240) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:183) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:179) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92) at utils.Test.getFirefoxDriver(Test.java:123) at webdsl.generated.functions.getFirefoxDriver_.getFirefoxDriver_(getFirefoxDriver_.java:18) at webdsl.generated.test.Test0.run(Test0.java:48) at utils.TestWeb.runTests(TestWeb.java:26) at utils.TestAll.runInWebAppContainer(TestAll.java:164) at utils.TestWeb.main(TestWeb.java:37) org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: (process:164): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed (process:164): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. Xlib: extension "RANDR" missing on display ":99".
Problem 2: Cannot start tomcat (timeout again)
Increased tomcat startup time is caused by secure random generation taking almost 2 minutes. We might want to increase the timeout for cargo here
INFO: Starting Servlet Engine: Apache Tomcat/7.0.40 Exception in thread "main" org.codehaus.cargo.container.ContainerException: Failed to start the Tomcat 7.x container. at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:173) at utils.TestAll.runInWebAppContainer(TestAll.java:161) at utils.TestWeb.main(TestWeb.java:37) Caused by: org.codehaus.cargo.container.ContainerException: Deployable [http://localhost:37680/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The Deployable state is thus unknown. at org.codehaus.cargo.container.spi.deployer.DeployerWatchdog.watch(DeployerWatchdog.java:111) at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForCompletion(AbstractLocalContainer.java:239) at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:167) ... 2 more org.codehaus.cargo.container.ContainerException: Deployable [http://localhost:37680/cargocpc/index.html] failed to finish deploying within the timeout period [120000]. The Deployable state is thus unknown. at org.codehaus.cargo.container.spi.deployer.DeployerWatchdog.watch(DeployerWatchdog.java:111) at org.codehaus.cargo.container.spi.AbstractLocalContainer.waitForCompletion(AbstractLocalContainer.java:239) at org.codehaus.cargo.container.spi.AbstractLocalContainer.start(AbstractLocalContainer.java:167) at utils.TestAll.runInWebAppContainer(TestAll.java:161) at utils.TestWeb.main(TestWeb.java:37) Jul 04, 2013 10:21:07 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [117,345] milliseconds.
Problem 3: Test already performed when webpage not loaded yet
In web tests that require some resources/computation (
Submitted by Elmer van Chastelet on 4 July 2013 at 16:20advanced-search-test
for instance), it may occur that a test statement is performed when the page has not finished loading. This may relate to theclick-and-wait
hack we use to allow web pages to load before performing a test statement. We need to find a way to guarantee that a web page finished loading before executing a test statement, but within some deadline.
Issue Log
We can add
-Djava.security.egd=file:/dev/urandom
to the JVM options for Tomcat to fix the slow SecureRandom.
Log in to post comments