CI/CD TestNG job fails when retries are done in the suite, need it to pass when the retry is successful

Problem: When the suite has retries(Implemented a retry listener) but no failures, at the completion of the CI/CD job it shows the following.
ERROR: Job failed: command terminated with exit code 1

This error code will flag the Job run as failed with a FAILED status.

I want to be able to say that the Job passed since all the tests completed albeit retries happened.

Locally through Intellij IDEA the same suite execution shows: “Process finished with exit code 0”

Question: Is there anything I can do to modify the result to reflect passed when there are retries but no failures?

Can you share the exact final command run by the script section of your job definition, that will drive the exit code?

The job executor itself isn’t truly aware of what your test phase actually does underneath, it only relies on the entire script’s exit code to decide the outcome of the job, opaquely.

Sorry about being so late, but the final command from the script is simply:

java -cp {JARFILE} {DARGS} org.testng.TestNG -testjar {JARFILE} -xmlpathinjar {TESTNG}