"Could not complete execution for Gradle Test Executor 2" error appears after gradle execution on bitbucket pipelines

Viewed 7085

Tools used:

Java 8
Gradle 4.0
Selenium
Selenium Grid
TestNG
Docker
Bitbucket
Bitbucket pipelines

When I'm executing my tests via bitbucket pipelines I've got these errors:

  1. "Could not complete execution for Gradle Test Executor 2" error (not whole suite executed. Total tests count: 29, executed 9, failed 2. One assertion error and another one is "Could not complete execution for Gradle Test Executor 2"; enter image description here

  2. If I did an execution again sometimes I have this error: "Failed Container 'docker' exceeded memory limit."enter image description here

Everything works fine when I'm running the tests locally. Any ideas on how this can be fixed?

3 Answers

Problem was solved by downgrading the TestNG dependency in build.gradle file from 7.0.1 to 6.14.3

Try to add --debug to your Gradle command and see if there are exceptions that are causing these failures.

I faced a similar problem because Gradle could not find the test listener class. After fixing that, the tests were easily able to run.

You probably need to change build.gradle file

for me, at the beginning it was:

test {
    useJUnitPlatform()
}

and it was not working properly

So I needed to change to:

test {
    useTestNG()
}

after that, all the tests are starting as expected.

Related