The Java chrome selenium CI test was suspended randomly for 3 hours
•
Java
Our CI Java chrome selenium test hangs randomly for 3 hours before socket timeout We get an error:
2015-08-31 10:18:47 INFO Util:343 - CHROME driver path :/mnt/jenkins/.jenkins/jobs/Automation_Tests_DISCERN_REVEAL/workspace/HfUiRegressionTests/lib/chromedriverLinux Starting ChromeDriver 2.16.333243 (0bfa1d3575fc1044244f21ddb82bf870944ef961) on port 19727 Only local connections are allowed. Aug 31,2015 1:18:50 PM org.openqa.selenium.os.UnixProcess$SeleniumWatchDog destroyHarder INFO: Command Failed to close cleanly. Destroying forcefully (v2). org.openqa.selenium.os.UnixProcess$SeleniumWatchDog@aaf5002 Aug 31,2015 1:18:51 PM org.openqa.selenium.os.UnixProcess destroy SEVERE: Unable to kill process with PID 7268 2015-08-31 13:18:51 ERROR Util:355 - Error in creating browser org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the Remote Server or browser start-up failure. Build info: version: '2.46.0',revision: '61506a4624b13675f24581e453592342b7485d71',time: '2015-06-04 10:22:50' System info: host: 'ip-10-234-60-163',ip: '10.234.60.163',os.name: 'Linux',os.arch: 'amd64',os.version: '3.2.0-67-virtual',java.version: '1.6.0_26' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:159) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:148) at com.healthfidelity.automation.util.Util.getDriver(Util.java:346) at com.healthfidelity.automation.core.ApplicationFactory.getApplication(ApplicationFactory.java:49) at com.healthfidelity.automation.commonstepdeFinition.reveal.RevealCommonSteps.navigateToREVEAL(RevealCommonSteps.java:38) at sun.reflect.GeneratedMethodAccessor42.invoke(UnkNown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at cucumber.runtime.Utils$1.call(Utils.java:37) at cucumber.runtime.Timeout.timeout(Timeout.java:13) at cucumber.runtime.Utils.invoke(Utils.java:31) at cucumber.runtime.java.JavaStepDeFinition.execute(JavaStepDeFinition.java:38) at cucumber.runtime.StepDeFinitionMatch.runStep(StepDeFinitionMatch.java:37) at cucumber.runtime.Runtime.runStep(Runtime.java:299) at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44) at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39) at cucumber.runtime.model.CucumberScenario.runBackground(CucumberScenario.java:59) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:42) at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at cucumber.api.junit.Cucumber.run(Cucumber.java:98) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.openqa.selenium.WebDriverException: java.net.socketTimeoutException: Read timed out Build info: version: '2.46.0',java.version: '1.6.0_26' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:76) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:578) ... 66 more Caused by: java.net.socketTimeoutException: Read timed out at java.net.socketInputStream.socketRead0(Native Method) at java.net.socketInputStream.read(SocketInputStream.java:129) at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:136) at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:152) at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:270) at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140) at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260) at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:161) at sun.reflect.GeneratedMethodAccessor16.invoke(UnkNown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.http.impl.conn.CPoolProxy.invoke(CPoolProxy.java:138) at $Proxy15.receiveResponseHeader(UnkNown Source) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:253) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:194) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:143) at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:89) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:134) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:67) ... 67 more
The low level debug message for the pending socket / port is:
[1:1:0826/201038:ERROR:image_Metadata_extractor.cc(111)] Couldn't load libexif. [32030:32030:0826/201038:INFO:audio_manager_pulse.cc(258)] Failed to connect to the context. Error: Connection refused [32065:32065:0826/201038:ERROR:sand@R_901_2419@_linux.cc(345)] InitializeSand@R_901_2419@() called with multiple threads in process gpu-process [32030:32030:0826/201038:WARNING:password_store_factory.cc(346)] Using basic (unencrypted) store for password storage. See http://code.google.com/p/chromium/wiki/LinuxPasswordStorage for more information about password storage options. [7:7:0826/201053:INFO:child_thread_impl.cc(666)] ChildThreadImpl::EnsureConnected()
When running CI tests in non fork mode, we ran out of permgen space:
Caught an exception while logging the end of the build. Exception was: java.lang.OutOfMemoryError: PermGen space java.lang.OutOfMemoryError: PermGen space PermGen space
We are currently running the JVM:
-XX:MaxPermSize=6144 -Xmx12288m
Solution
You can try docker selenium. The idea is that docker runs a container, starts your test, and then destroys the container, so it's all cleaned up
https://github.com/elgalu/docker-selenium#usage
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码