0

Our Automation project is written in Java, and we are using the following libraries: Cucumber 3.1.6 Selenium 4.0.0 awaitility 3.1.6 We are executing several Jenkins jobs in parallel, in a Selenium Grid Docker version: 4.7.2 with a Hub and Chrome node configuration. Executed in browser: chrome version 108.0.5359.124 He have random errors in the execution of the parallels scenarios with the following error: java.util.concurrent.TimeoutException We are using some fluent waits coded using the awaitility library, for example:

await().atMost(new Duration(seconds, TimeUnit.SECONDS)).with()
    .pollInterval(new Duration(times, TimeUnit.SECONDS)).until(clickElement(element));

This is the random error executing several jobs in parallel, not detected executing a single job. The error is not detected executing parallel jobs in a Selenium grid in a Virtual machine without docker.

org.awaitility.core.ConditionTimeoutException: Condition returned by method ...
        at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:145)
        at org.awaitility.core.CallableCondition.await(CallableCondition.java:79)
        at org.awaitility.core.CallableCondition.await(CallableCondition.java:27)
        at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:902)
        at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:860)
        at pageobjectmodel.OMSBasePOM.waitAndClickAppearsElement(OMSBasePOM.java:808)
        at pageobjectmodel.OMSBasePOM.setFilterToColumn(OMSBasePOM.java:445)
        at pageobjectmodel.CommonPOM.setFilterInTable(CommonPOM.java:72)
        at automationoms.CommonSteps.weSetTheFilterOnTheTableWithColumnAndValue(CommonSteps.java:242)
        at ?.we set the filter on the table with column "Code" and value "AUT"(classpath:automationoms/upstream/ZZ_To%20Delete/00_KuberneteGridCheck.feature:10)
Caused by: java.util.concurrent.TimeoutException
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:204)
        at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:91)
        at org.awaitility.core.CallableCondition.await(CallableCondition.java:79)
        at org.awaitility.core.CallableCondition.await(CallableCondition.java:27)
        at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:902)
        at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:860)
        at pageobjectmodel.OMSBasePOM.waitAndClickAppearsElement(OMSBasePOM.java:808)
        at pageobjectmodel.OMSBasePOM.setFilterToColumn(OMSBasePOM.java:445)
        at pageobjectmodel.CommonPOM.setFilterInTable(CommonPOM.java:72)
        at automationoms.CommonSteps.weSetTheFilterOnTheTableWithColumnAndValue(CommonSteps.java:242)
        at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at cucumber.runtime.Utils$1.call(Utils.java:26)
        at cucumber.runtime.Timeout.timeout(Timeout.java:16)
        at cucumber.runtime.Utils.invoke(Utils.java:20)
        at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:57)
        at cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50)
        at cucumber.runner.TestStep.executeStep(TestStep.java:65)
        at cucumber.runner.TestStep.run(TestStep.java:50)
        at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43)
        at cucumber.runner.TestCase.run(TestCase.java:46)
        at cucumber.runner.Runner.runPickle(Runner.java:50)
        at io.cucumber.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:146)
        at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:68)
        at io.cucumber.junit.FeatureRunner.runChild(FeatureRunner.java:23)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at io.cucumber.junit.Cucumber.runChild(Cucumber.java:144)
        at io.cucumber.junit.Cucumber.runChild(Cucumber.java:65)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at io.cucumber.junit.Cucumber$RunCucumber.evaluate(Cucumber.java:174)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
        at org.testng.junit.JUnit4TestRunner.start(JUnit4TestRunner.java:81)
        at org.testng.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:69)
        at org.testng.TestRunner$1.run(TestRunner.java:697)
        at org.testng.TestRunner.runJUnitWorkers(TestRunner.java:1004)
        at org.testng.TestRunner.privateRunJUnit(TestRunner.java:728)
        at org.testng.TestRunner.run(TestRunner.java:629)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
        at org.testng.SuiteRunner.run(SuiteRunner.java:268)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
        at org.testng.TestNG.run(TestNG.java:1064)
        at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:135)
        at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:198)
        at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94)
        at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:146)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
        at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

Confirm that there is problem using the library awaitility in an automation project and executing the test in a Selenium Grid in docker.

xyuste
  • 1
  • 1

1 Answers1

0

after several tries, with the last version of awaitility.jar our conclusion is:

The error causes with the use of the awaitility library in the implementation of the dynamic wait, and when executing Jobs in parallel in a Selenium Grid Docker.

Using the selenium WebdriverWait instead of the awaitility, no errors happens:

    WebDriverWait newWait = new WebDriverWait(driver, java.time.Duration.ofSeconds(30));
    newWait.until(ExpectedConditions.elementToBeClickable(ARROW_COLUMN_FILTER_LOCATOR)).click();

We hope this can help other users Regards

xyuste
  • 1
  • 1