Make JUnit Tests reliable again #669
Labels
enhancement
New feature or request
refined
Issue in new state was discussed with the team and is clear
Milestone
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:
&
is really that important for the end-user or if we simply want to prevent all this background and async processing. Still we start the real process in BACKGROUND mode - but however in JUnits we mock the process mode inProcessContextTestImpl
so we never actually run processes directly withProcessMode.BACKGROUND
.The text was updated successfully, but these errors were encountered: