Copilot commented on code in PR #3649:
URL: https://github.com/apache/maven-surefire/pull/3649#discussion_r4729306693


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/ConsoleOutputFileReporter.java:
##########
@@ -168,6 +187,21 @@ private String extractTestClassFromStack(String stack) {
         return null;
     }
 
+    private String getClassName(TestSetReportEntry reportEntry) {
+        return usePhrasedFileName ? reportEntry.getSourceText() : 
reportEntry.getSourceName();
+    }
+
+    private void closeStream(String className) {
+        FilterOutputStream stream = className == null ? null : 
outputStreams.remove(className);

Review Comment:
   Removing the completed class from `outputStreams` also removes its identity 
from `extractTestClassFromStack()`, which only recognizes keys in that map. If 
A finishes, B starts, and a background thread from A then prints with 
`A#method` in its captured stack, the output now falls back to B's filename 
instead of being appended to A's file. Keep completed classes eligible for 
stack matching (using `startedClasses`) independently of their open streams.



-- 
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