Skip to content

L3 Automation Execute jacoco:dump connection refused to localhost/127.0.0.1:6300

0

I want to execute all tests cases (run execute.xml Ant script) for carddemo-automation. The build failed and i get these error : Connecting to localhost/127.0.0.1:6300 Connection refused

AWS

asked 2 years ago192 views

2 Answers
0

The issue you're experiencing with the L3 Automation Execute step, where you're getting a "Connection refused" error when trying to connect to localhost:6300 for the jacoco:dump, is likely related to the Tomcat server not running or shutting down prematurely.

This problem often occurs because the Tomcat server is instructed to stop after all test cases are executed, which happens before the Jacoco report can be generated. The connection to port 6300 is refused because the server is no longer running when the jacoco:dump tries to connect.

To resolve this issue, you can try the following:

  1. Modify the Execution.xml file to postpone the Tomcat shutdown until after the Jacoco report is generated. This will ensure the server is still running when jacoco:dump attempts to connect.

  2. Add some debug messages in your Execution.xml to help you understand the sequence of events and confirm if Tomcat is shutting down as expected.

  3. Check the Tomcat log folder and the execution.log for any error messages or unexpected behavior that might be causing the server to shut down prematurely.

  4. Ensure that your test results are otherwise OK and that the expected files are being generated. The scheduled shutdown of Tomcat after test execution is normal behavior, but it should occur after all necessary operations are complete.

  5. Verify that no other process is using port 6300, which could prevent Jacoco from connecting.

If the problem persists after trying these steps, you may need to review your test configuration and ensure that all components are properly set up and running in the correct order.
Sources
L3-Automation-Execute-Online test cases error(tomcat server shutting down after batch test) | AWS re:Post

answered 2 years ago

  • test results are not ok. Jacoco doesn't start and does'nt execute tests even if i added setenv.bat to tomcat/bin to enable jacoco

0

A build failure indicates that the test case execution is not complete. (Ant Build Failed). Instead of executing all test cases at once, isolate the issue by running only one test case in the properties.xml file. Set the alll.tests.cases to the desired test, such as 01-batches. The property name is "tests.cases" and the value is "${"batches.tests.cases}". Check the execution.log file in each test case folder to see if it shows "Built Success.". You may need to debug the Jacoco report dump and report writing processes after the automated test is completed. I find it beneficial to include debug messages. <echo message="Debug ******: Starting JaCoCo dump for [@{testCase}]"/> <jacoco-dump-exec testCase="@{testCase}"/> <echo message="Debug: generating JaCoCo report for [@{testCase}]"/><jacoco-test-case-report testCase="@{testCase}" />. I attempted to move the Tomcat shutdown to the end of the Data Comparison using a gentle shutdown. <echo message="Debug : Gracefully Stopping Tomcat"/><sequential><sleep seconds="5"/> <tomcat-stop /><sleep seconds="10"/> </sequential> . Good luck.

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.