Hello team,

We are upgrading our apps to Java 17, where when running the integration tests we are facing an issue,

we run the mockserver using this command: cd ../../srv && mvn -s ../../settings.xml clean spring-boot:run -Dspring-boot.run.arguments="--centralservices.logging.appender=STDOUT-OPA"

we run the mockui using this command:npm run test:defaultLanguage && npm run test:projectReplicationFilter && npm run test:resourceOrganization, which runs the test journeys

File for reference: https://github.tools.sap/Cloud4RM/Central-Services/blob/18747463cfe940e9585d471775514573136319b1/tests/ui-integration/package.json

The expected result is

info shellExecute - [all ] ✔ Teardown
info shellExecute - [all ]
info shellExecute - [all ] Finished in 1 min 18.985 secs / 1 min 18.976 secs @ 02:49:35 GMT+0000 (Coordinated Universal Time)
info shellExecute - [all ]
info shellExecute - [all ] SUMMARY:
info shellExecute - [all ] ✔ 28 tests completed
info shellExecute - [all ]
info shellExecute - [all ] Done.
info shellExecute - [server] INFO [SpringApplicationShutdownHook] [] - [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown initiated...
info shellExecute - [server] INFO [SpringApplicationShutdownHook] [] - [com.zaxxer.hikari.HikariDataSource] - HikariPool-1 - Shutdown completed.
info shellExecute - [server] [INFO] ------------------------------------------------------------------------

[all ] indicates the mockui. [server] indicates the mockserver, which is getting terminated.

But, the actual output is :

info shellExecute - Finished in 2 mins 13.748 secs / 2 mins 13.7 secs @ 14:48:17 GMT+0000 (Coordinated Universal Time)
info shellExecute - [1]
info shellExecute - [1] SUMMARY:
info shellExecute - [1] ✔ 28 tests completed
info shellExecute - [1]
info shellExecute - [1] Done.
info shellExecute - [1] npm run all exited with code 0

I believe [1] indicates mockui, but the server is not getting termiinated. After 1 hour of the stage run , the timeout issue occurs, which terminates the stage. https://dev.azure.com/hyperspace-pipelines/Cloud4RM/_build/results?buildId=1522043&view=logs&j=adb33f84-2ccf-5098-10a9-dbd469cb198a

Regards, Keerthana

Comment From: scottfrederick

@Keerthu8999 From the information you've provided, it's not clear what Spring Boot should be doing. The command mvn spring-boot:run will run the Spring Boot application until something external to the app terminates it (assuming it is a web application). If something else in your test setup is expected to stop the app after tests are run, that is out of Spring Boot's control.

If you would like us to spend some time investigating, please provide a complete minimal sample that reproduces the problem. The sample should have the fewest dependencies possible to help us to see what you expect and what is happening. You can share it with us by pushing it to a separate repository on GitHub or by zipping it and attaching it to this issue.

Comment From: devikaachu

Based on the provided information, the issue is related to the mock server not terminating properly after the integration tests are completed. The mockui is completed successfully, but the server is not getting terminated.

One possible reason for this could be that there is still a running process that is holding onto the mock server instance. You can try running the following command to check if there are any running processes related to the mock server: lsof -i: port Replace the port with the port number on which the mock server is running. This will list all the processes that are currently using that port.

You can also try killing the process manually by running the following command: kill $(lsof -t -i : `port)` Replace the port with the port number on which the mock server is running.

Another possible reason for this could be related to the changes in Java 17, which might have caused some issues in the integration tests. You can try running the integration tests using Java 16 or earlier versions to check if the issue is related to Java 17.

Also, you can try adding some logging statements to the mock server code to see if any exceptions or errors occur during the termination process.

I hope this helps! Feel free to let me know if you have any more questions.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.