devonfw / IDEasy

Tool to automate the setup and updates of a development environment for any project (Successor of devonfw-ide).
Apache License 2.0
8 stars 22 forks source link

Make JUnit Tests reliable again #669

Open hohwille opened 2 weeks ago

hohwille commented 2 weeks ago

As a IDEasy developer, I want to have deterministic JUnit tests so that I can rely on their results and CI status.

It all started with #648 where we changed our generated start-script that delegates to the actual tool to run in background.

Since that is now processing asynchronous in the background the process may terminate for Java before the output is printed and received. As a workaround we started writing the output to a file instead of echoing it and assuming that it will be captured and logged. Therefore also the assertions all had to be refactored to assert the message not from the logs anymore but from the file where the script is writing the output to. Now in #667 we had the effect that even that failed because the file was created in background while the JUnit in the foreground ran the assertion for the file before it was actually created in the background.

Thoughts:

hohwille commented 2 weeks ago

I assume the error will come back. We can simply reopen and remove milestone if that happens.

jan-vcapgemini commented 5 days ago

Issue still occurs as seen in: https://github.com/devonfw/IDEasy/actions/runs/11340850609/job/31537989280?pr=674 So we need to re-open this issue.