PeterZh6 opened a new issue, #11148:
URL: https://github.com/apache/inlong/issues/11148

   ### What happened
   
   When running tests of the `sort-end-to-end-test-v1.15` module using `mvn 
test`, the logs from the tests are not displayed correctly due to Log4j2's 
failure to load configurations from the configuration file 
`log4j2-test.properties` located at 
`inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/resources/log4j2-test.properties`.
   
   Instead of using the `log4j2-test.properties` file, Log4j2 does not load the 
correct configuration, which results in incomplete or missing log output during 
the tests. This issue prevents useful logging feedback, which is particularly 
important given the long runtime of end-to-end tests.
   
   Additional Context:
   Initially, the `log4j2-test.properties` file was located in the correct 
`src/test/resources` directory. However, it seems Log4j2 was unable to 
automatically detect and load the configuration.
   
   A screenshot of the error logs (or missing log output) is provided below:
   
![image](https://github.com/user-attachments/assets/4ce04b5b-b74b-40a9-9fd5-19d84000cccf)
   
   
   ### What you expected to happen
   
   Logs should be printed correctly during the test run, as shown in the 
expected logs screenshot below. Since the end-to-end tests typically take a 
long time, it is important that prompt feedback from the logs is available to 
track the progress and debug any issues effectively.
   
   Expected correct logs are shown here:
   
![image](https://github.com/user-attachments/assets/e6dd35a1-c7a4-41ab-a2e6-7caa6e94d089)
   
   
   ### How to reproduce
   
   Properly install the inLong project in the local Maven repository.
   Navigate to the directory: 
`inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15`.
   Run `mvn test`.
   Observe the logs or lack thereof, and the failure of Log4j2 to load the 
configuration from `log4j2-test.properties`.
   
   ### Environment
   
   OS: WSL (Windows Subsystem for Linux) running Linux Ubuntu 22.04
   Maven: 3.6.3
   JDK: 8
   
   ### InLong version
   
   master
   
   ### InLong Component
   
   InLong Sort
   
   ### Are you willing to submit PR?
   
   - [X] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to