How does test runner know which output belongs to which junit test?

Dear IntelliJ community,

I do not know how junit tests are ran under the hood exactly, but I have a question on how it's output is shown on the output pane on the test runner tab.

Sometimes, I use System.out.println() statements to display some information in junit tests. I then click on the particular junit test in the test tree of the test runner tab.
There I regularly see that the last part of the output of the previous test or the start of the next test is also visible.
To me it seems a synchronisation issue between different output streams perhaps.

Does anybody how to improve here? Maybe I should use something else then System.out.println()?


Please sign in to leave a comment.