Paralel test timeout error
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Paralel test timeout error
I have few tests which run in parallel via maven surefire plugin. Sometimes about 8:1 some test crashes on error: org.openqa.selenium.ScriptTimeoutException: java.util.concurrent.TimeoutException It seems it is related to parallel run but I don't know how to fix it. Tests run against Selenium standalone server 4, which is on the same server as the test runner and teste application. Here is maven surefire plugin implemantation:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<parallel>methods</parallel>
<useUnlimitedThreads>true</useUnlimitedThreads>
<includes>
<include>${category}</include>
</includes>
</configuration>
</plugin>
and here is the whole error log:
org.openqa.selenium.ScriptTimeoutException: java.util.concurrent.TimeoutException Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'vmi503579.contaboserver.net', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-70-generic', java.version: '11.0.10' selenide.remote: http://127.0.0.1:4444 Driver info: org.openqa.selenium.remote.RemoteWebDriver selenide.url: https://tatrytec.eu Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 89.0.4389.114, chrome: {chromedriverVersion: 89.0.4389.23 (61b08ee2c5002..., userDataDir: /tmp/.com.google.Chrome.rtlmvi}, goog:chromeOptions: {debuggerAddress: localhost:42525}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), se:cdp: http://173.249.58.30:4444/s..., setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true} selenide.baseUrl: https://tatrytec.eu Session ID: 9eacdc08d0171e3ebc29cd2e7ae64cfc at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:277) at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:857) at com.codeborne.selenide.drivercommands.Navigator.lambda$navigateTo$0(Navigator.java:70) at com.codeborne.selenide.logevents.SelenideLogger.run(SelenideLogger.java:139) at com.codeborne.selenide.drivercommands.Navigator.navigateTo(Navigator.java:66) at com.codeborne.selenide.drivercommands.Navigator.open(Navigator.java:30) at com.codeborne.selenide.SelenideDriver.open(SelenideDriver.java:86) at com.codeborne.selenide.Selenide.open(Selenide.java:49) at steps.BaseSteps.openPage(BaseSteps.java:68) at steps.admin.AdminPageSteps.logInAndOpenAdminPage(AdminPageSteps.java:21) at ✽.User is logged in and is on admin page(file:///home/tatrytec/selenium-tests/cucumber.tatrytec.eu/src/test/features/admin/CreateEditCategory.feature:28)
Screenshot
Thanks a lot for any help. I really don't know what is the problem.
- Labels:
-
Cucumber-JVM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are so many reason for such error, but I'm not sure cucumber would have anything to do with it actually.
- make sure the timeouts are not configured too low based on what you are trying to test: check and try increasing some
- make sure you don't overload your test environment: parallel execution with selenium can easily overload a system resources - memory and CPU - specifically inside VMs or such environment: check the resources of your environment, maybe think about reducing the number of parallel execution
- make sure your selenium automation is set-up properly, allowing several instances of the browser to be executed in parallel
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can I ask which timeouts do you mean? Also how to set up number of parallel test properly? My settings comes from documentation. I did not find any other resources about it.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The selenium timeouts, like the one that your are facing.
To setup the number of parallel execution properly, it is up to you to check what can handle your system and to adjust.
Which documentation are you talking about?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had the scriptTimeout set to 120 seconds. As I remove the parallel run the problem is for 95% gone. The problem was in unlimited count of threads.
This is working version for my VPS
<parallel>methods</parallel>
<threadCount>2</threadCount>
<perCoreThreadCount>false</perCoreThreadCount>
Thanks for help.
